get_widget
Description:
[
CCode ( cname =
"gimp_procedure_dialog_get_widget" ) ]
public unowned Widget get_widget (
string property,
Type widget_type)
Creates a new Widget for property according to the property type.
The following types are possible:
- g_type_param_boolean: * gtk_type_check_button (default) *
gtk_type_switch
- g_type_param_int, g_type_param_uint, or
g_type_param_double: * gimp_type_label_spin (default): a spin
button with a label. * gimp_type_scale_entry: a scale entry with label. *
gimp_type_spin_scale: a spin scale with label embedded. *
gimp_type_spin_button: a spin button with no label.
- g_type_param_string: * gimp_type_label_entry (default): an entry
with a label. * gtk_type_entry: an entry with no label. *
gtk_type_text_view: a text view with no label.
- gimp_type_choice (default will depend on the number of choices): *
gtk_type_combo_box: a combo box displaying every choice. * gimp_type_int_radio_frame: a
frame with radio buttons.
- gegl_type_color: * gimp_type_label_color (default): a color
button with a label. Please use get_color_widget for a
non-editable color area with a label. * gimp_type_color_button: a color button with no label. *
gimp_type_color_area: a color area with no label.
- gimp_type_param_file: * gtk_file_chooser_button (default):
generic file chooser widget using the action mode of the param spec. Note that it won't work with a [enum@Gimp.FileChooserAction.ANY]
action. If you intend to display a widget for a file param spec, you should always set it to a more specific action. See [
method@Gimp.Procedure.add_file_argument].
- g_type_param_unit: * gimp_type_unit_combo_box
- gimp_type_param_item (any subtype, such as layer, channel or path): *
gimp_type_item_chooser (default): a widget allowing to choose among items of the specific subtype, within all images opened in
GIMP. * gimp_type_drawable_chooser (deprecated): this type of widget is now deprecated. You should
update your code to request a gimpitemchooser instead.
- gimp_type_param_image: * gimp_type_image_chooser: a widget
allowing to choose among images opened in GIMP.
If the widget_type is not supported for the actual type of property, the function will fail. To keep the
default, set to g_type_none.
Note that this function will not ensure that its default returned widget type will always be the same. If you want to make sure that no
breakage will ensure in your code, in particular if you are further tweaking the widget with `GTK` or `libgimpui` API, you should always
call with the specific widget_type.
If a widget has already been created for this procedure, it will be returned instead (even if with a different widget_type).
Parameters:
| this |
the associated ProcedureDialog.
|
| property |
name of the property to build a widget for. It must be a property of the
Procedure this has been created for.
|
| widget_type |
alternative widget type. g_type_none will create the default type of widget for the associated
property type.
|
Returns:
|
the Widget representing property. The object belongs to
this and must not be freed.
|