GimpUi.ProcedureDialog

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned GimpUi.Dialog GimpUi.Dialog GimpUi.ProcedureDialog GimpUi.ProcedureDialog GimpUi.Dialog->GimpUi.ProcedureDialog Gtk.Bin Gtk.Bin Gtk.Window Gtk.Window Gtk.Bin->Gtk.Window Gtk.Buildable->Gtk.Widget Gtk.Container Gtk.Container Gtk.Container->Gtk.Bin Gtk.Dialog Gtk.Dialog Gtk.Dialog->GimpUi.Dialog Gtk.Widget->Gtk.Container Gtk.Window->Gtk.Dialog

Subclasses:

GimpUi.ExportProcedureDialog, GimpUi.VectorLoadProcedureDialog

Methods

Inherited:

GimpUi.Dialog (4), Gtk.Dialog (14), Gtk.Window (119), Gtk.Bin (1), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10)

Structs:

Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)

class

new (procedure, config, title)

fill (properties)

fill_box (container_id, properties)

fill_expander (container_id, title_id, invert_title, contents_id)

fill_flowbox (container_id, properties)

fill_frame (container_id, title_id, invert_title, contents_id)

fill_notebook (container_id, label_list, page_list)

fill_paned (container_id, orientation, child1_id, child2_id)

fill_scrolled_window (container_id, contents_id)

get_color_widget (property, editable, type)

get_drawable_preview (preview_id, drawable)

get_int_combo (property, store)

get_int_radio (property, store)

get_label (label_id, text, is_markup, with_mnemonic)

get_scale_entry (property, factor)

get_size_entry (property, property_is_pixel, unit_property, unit_format, update_policy, resolution)

get_spin_scale (property, factor)

get_widget (property, widget_type)

run ()

set_ok_label (ok_label)

set_sensitive (property, sensitive, config, config_property, config_invert)

set_sensitive_if_in (property, config, config_property, values, in_values)

Virtual Methods

Inherited:

Gtk.Dialog (2), Gtk.Window (5), Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10)

do_fill_end (procedure, config)

do_fill_start (procedure, config)

Properties

Inherited:

GimpUi.Dialog (2), Gtk.Dialog (1), Gtk.Window (33), Gtk.Container (3), Gtk.Widget (39)

Name

Type

Flags

Short Description

config

Gimp.ProcedureConfig

r/w/c

The Gimp.ProcedureConfig this dialog is editing

procedure

Gimp.Procedure

r/w/co

The Gimp.Procedure this dialog is used with

Style Properties

Inherited:

Gtk.Dialog (4), Gtk.Window (2), Gtk.Widget (17)

Signals

Inherited:

Gtk.Dialog (2), Gtk.Window (5), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Fields

Inherited:

Gtk.Dialog (2), Gtk.Window (5), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Name

Type

Access

Description

parent_instance

GimpUi.Dialog

r

Class Details

class GimpUi.ProcedureDialog(*args, **kwargs)
Bases:

GimpUi.Dialog

Abstract:

No

Structure:

GimpUi.ProcedureDialogClass

classmethod new(procedure, config, title)
Parameters:
Returns:

the newly created GimpUi.ProcedureDialog.

Return type:

Gtk.Widget

Creates a new dialog for procedure using widgets generated from properties of config. A None title will only be accepted if a menu label was set with Gimp.Procedure.set_menu_label() (this menu label will then be used as dialog title instead). If neither an explicit label nor a procedure menu label was set, the call will fail.

As for all Gtk.Window, the returned GimpUi.ProcedureDialog object is owned by GTK and its initial reference is stored in an internal list of top-level windows. To delete the dialog, call Gtk.Widget.destroy().

fill(properties)
Parameters:

properties ([str] or None) – the list of property names.

Populate self with the widgets corresponding to every listed properties. If the list is None, self will be filled by the whole list of properties of the associated Gimp.Procedure, in the defined order:

gimp_procedure_dialog_fill_list (dialog, NULL);

Nevertheless if you only wish to display a partial list of properties, or if you wish to change the display order, then you have to give an explicit list:

gimp_procedure_dialog_fill (dialog, "property-1", "property-2", NULL);

Note: you do not have to call GimpUi.ProcedureDialog.get_widget() on every property before calling this function unless you want a given property to be represented by an alternative widget type. By default, each property will get a default representation according to its type.

fill_box(container_id, properties)
Parameters:
  • container_id (str) – a container identifier.

  • properties ([str] or None) – the list of property names.

Returns:

the Gtk.Box representing property. The object belongs to self and must not be freed.

Return type:

Gtk.Widget

Creates and populates a new Gtk.Box with widgets corresponding to every listed properties. If the list is empty, the created box will be filled by the whole list of properties of the associated Gimp.Procedure, in the defined order. This is similar of how GimpUi.ProcedureDialog.fill() works except that it creates a new widget which is not inside self itself.

The container_id must be a unique ID which is neither the name of a property of the Gimp.ProcedureConfig associated to self, nor is it the ID of any previously created container. This ID can later be used together with property names to be packed in other containers or inside self itself.

fill_expander(container_id, title_id, invert_title, contents_id)
Parameters:
  • container_id (str) – a container identifier.

  • title_id (str or None) – the identifier for the title widget.

  • invert_title (bool) – whether to use the opposite value of title_id if it represents a boolean widget.

  • contents_id (str or None) – the identifier for the contents.

Returns:

the Gtk.Widget representing container_id. The object belongs to self and must not be freed.

Return type:

Gtk.Widget

Creates a new Gtk.Expander and packs title_id as its title and contents_id as content. If title_id represents a boolean property, its value will be used to expand the Gtk.Expander. If invert_title is True, then expand binding is inverted.

The container_id must be a unique ID which is neither the name of a property of the Gimp.ProcedureConfig associated to self, nor is it the ID of any previously created container. This ID can later be used together with property names to be packed in other containers or inside self itself.

fill_flowbox(container_id, properties)
Parameters:
  • container_id (str) – a container identifier.

  • properties ([str] or None) – the list of property names.

Returns:

the Gtk.FlowBox representing property. The object belongs to self and must not be freed.

Return type:

Gtk.Widget

Creates and populates a new Gtk.FlowBox with widgets corresponding to every listed properties. If the list is empty, the created flowbox will be filled by the whole list of properties of the associated Gimp.Procedure, in the defined order. This is similar of how GimpUi.ProcedureDialog.fill() works except that it creates a new widget which is not inside self itself.

The container_id must be a unique ID which is neither the name of a property of the Gimp.ProcedureConfig associated to self, nor is it the ID of any previously created container. This ID can later be used together with property names to be packed in other containers or inside self itself.

fill_frame(container_id, title_id, invert_title, contents_id)
Parameters:
  • container_id (str) – a container identifier.

  • title_id (str or None) – the identifier for the title widget.

  • invert_title (bool) – whether to use the opposite value of title_id if it represents a boolean widget.

  • contents_id (str or None) – the identifier for the contents.

Returns:

the Gtk.Widget representing container_id. The object belongs to self and must not be freed.

Return type:

Gtk.Widget

Creates a new Gtk.Frame and packs title_id as its title and contents_id as its child. If title_id represents a boolean property, its value will be used to renders contents_id sensitive or not. If invert_title is True, then sensitivity binding is inverted.

The container_id must be a unique ID which is neither the name of a property of the Gimp.ProcedureConfig associated to self, nor is it the ID of any previously created container. This ID can later be used together with property names to be packed in other containers or inside self itself.

fill_notebook(container_id, label_list, page_list)
Parameters:
  • container_id (str) – a container identifier.

  • label_list ([str]) – the list of label IDs.

  • page_list ([str]) – the list of page IDs.

Returns:

the Gtk.Notebook representing property. The object belongs to self and must not be freed.

Return type:

Gtk.Widget

Creates and populates a new Gtk.Notebook with widgets corresponding to every listed properties. This is similar of how GimpUi.ProcedureDialog.fill() works except that it creates a new widget which is not inside self itself.

The container_id must be a unique ID which is neither the name of a property of the Gimp.ProcedureConfig associated to self, nor is it the ID of any previously created container. This ID can later be used together with property names to be packed in other containers or inside self itself.

fill_paned(container_id, orientation, child1_id, child2_id)
Parameters:
  • container_id (str) – a container identifier.

  • orientation (Gtk.Orientation) –

  • child1_id (str or None) – the first child’s ID.

  • child2_id (str or None) – the second child’s ID.

Returns:

the Gtk.Paned representing property. The object belongs to self and must not be freed.

Return type:

Gtk.Widget

Creates and populates a new Gtk.Paned containing widgets corresponding to child1_id and child2_id. This is similar of how GimpUi.ProcedureDialog.fill() works except that it creates a new widget which is not inside self itself.

The container_id must be a unique ID which is neither the name of a property of the Gimp.ProcedureConfig associated to self, nor is it the ID of any previously created container. This ID can later be used together with property names to be packed in other containers or inside self itself.

fill_scrolled_window(container_id, contents_id)
Parameters:
  • container_id (str) – a container identifier.

  • contents_id (str) – The identifier for the contents.

Returns:

the Gtk.ScrolledWindow representing contents_id. The object belongs to self and must not be freed.

Return type:

Gtk.Widget

Creates and populates a new Gtk.ScrolledWindow with a widget corresponding to the declared content id.

The container_id must be a unique ID which is neither the name of a property of the Gimp.ProcedureConfig associated to self, nor is it the ID of any previously created container. This ID can later be used together with property names to be packed in other containers or inside self itself.

get_color_widget(property, editable, type)
Parameters:
Returns:

a GimpUi.LabelColor representing property. The object belongs to self and must not be freed.

Return type:

Gtk.Widget

Creates a new widget for property which must necessarily be a Gegl.Color property. This must be used instead of GimpUi.ProcedureDialog.get_widget() when you want a GimpUi.LabelColor which is not customizable for a color property, or when to set a specific type.

If a widget has already been created for this procedure, it will be returned instead (whatever its actual widget type).

get_drawable_preview(preview_id, drawable)
Parameters:
Returns:

the Gtk.Widget representing preview_id. The object belongs to self and must not be freed.

Return type:

Gtk.Widget

Gets or creates a new GimpUi.DrawablePreview for drawable. If a widget with the preview_id has already been created for this procedure, it will be returned instead.

The preview_id ID can later be used together with property names to be packed in other containers or inside self itself.

get_int_combo(property, store)
Parameters:
Returns:

the Gtk.Widget representing property. The object belongs to self and must not be freed.

Return type:

Gtk.Widget

Creates a new GimpUi.LabelIntWidget for property which must necessarily be an integer or boolean property. This must be used instead of GimpUi.ProcedureDialog.get_widget() when you want to create a combo box from an integer property.

If a widget has already been created for this procedure, it will be returned instead (whatever its actual widget type).

get_int_radio(property, store)
Parameters:
Returns:

the Gtk.Widget representing property. The object belongs to self and must not be freed.

Return type:

Gtk.Widget

Creates a new #GimpLabelIntRadioFrame for property which must necessarily be an integer, enum or boolean property. This must be used instead of GimpUi.ProcedureDialog.get_widget() when you want to create a group of Gtk.RadioButton-s from an integer property.

If a widget has already been created for this procedure, it will be returned instead (whatever its actual widget type).

get_label(label_id, text, is_markup, with_mnemonic)
Parameters:
  • label_id (str) – the label for the Gtk.Label.

  • text (str) – the text for the label.

  • is_markup (bool) – whether text is formatted with Pango markup.

  • with_mnemonic (bool) – whether text contains a mnemonic character.

Returns:

the Gtk.Widget representing label_id. The object belongs to self and must not be freed.

Return type:

Gtk.Widget

Creates a new Gtk.Label with text. It can be useful for packing textual information in between property settings.

If label_id is an existing string property of the Gimp.ProcedureConfig associated to self, then it will sync to the property value. In this case, text should be None.

If label_id is a unique ID which is neither the name of a property of the Gimp.ProcedureConfig associated to self, nor is it the ID of any previously created label or container, it will be initialized to text. This ID can later be used together with property names to be packed in other containers or inside self itself.

get_scale_entry(property, factor)
Parameters:
  • property (str) – name of the int property to build a combo for. It must be a property of the Gimp.Procedure self has been created for.

  • factor (float) – a display factor for the range shown by the widget.

Returns:

the Gtk.Widget representing property. The object belongs to self and must not be freed.

Return type:

Gtk.Widget

Creates a new GimpUi.ScaleEntry for property which must necessarily be an integer or double property. This can be used instead of GimpUi.ProcedureDialog.get_widget() in particular if you want to tweak the display factor. A typical example is showing a [0.0, 1.0] range as [0.0, 100.0] instead (factor = 100.0).

If a widget has already been created for this procedure, it will be returned instead (whatever its actual widget type).

get_size_entry(property, property_is_pixel, unit_property, unit_format, update_policy, resolution)
Parameters:
  • property (str) – name of the int property to build an entry for. It must be a property of the Gimp.Procedure self has been created for.

  • property_is_pixel (bool) – when True, the property value is in pixels, and in the selected unit otherwise.

  • unit_property (str) – name of unit property.

  • unit_format (str) – a printf-like unit-format string used for unit labels.

  • update_policy (GimpUi.SizeEntryUpdatePolicy) – how the automatic pixel <-> real-world-unit calculations should be done.

  • resolution (float) – the resolution (in dpi) for the field.

Returns:

the Gtk.Widget representing property. The object belongs to self and must not be freed.

Return type:

Gtk.Widget

Creates a new GimpUi.SizeEntry for property which must necessarily be an integer or double property. The associated unit_property must be a Gimp.Unit or integer property.

If a widget has already been created for this procedure, it will be returned instead (whatever its actual widget type).

get_spin_scale(property, factor)
Parameters:
  • property (str) – name of the int or double property to build a GimpUi.SpinScale for. It must be a property of the Gimp.Procedure self has been created for.

  • factor (float) – a display factor for the range shown by the widget. It must be set to 1.0 for integer properties.

Returns:

the Gtk.Widget representing property. The object belongs to self and must not be freed.

Return type:

Gtk.Widget

Creates a new GimpUi.SpinScale for property which must necessarily be an integer or double property. This can be used instead of GimpUi.ProcedureDialog.get_widget() in particular if you want to tweak the display factor. A typical example is showing a [0.0, 1.0] range as [0.0, 100.0] instead (factor = 100.0).

If a widget has already been created for this procedure, it will be returned instead (whatever its actual widget type).

get_widget(property, widget_type)
Parameters:
  • property (str) – name of the property to build a widget for. It must be a property of the Gimp.Procedure self has been created for.

  • widget_type (GObject.GType) – alternative widget type. GObject.TYPE_NONE will create the default type of widget for the associated property type.

Returns:

the Gtk.Widget representing property. The object belongs to self and must not be freed.

Return type:

Gtk.Widget

Creates a new Gtk.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 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:

    • %GTK_TYPE_COMBO_BOX (default): 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 GimpUi.ProcedureDialog.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

If the widget_type is not supported for the actual type of property, the function will fail. To keep the default, set to GObject.TYPE_NONE.

If a widget has already been created for this procedure, it will be returned instead (even if with a different widget_type).

run()
Returns:

True if the dialog was validated, False otherwise.

Return type:

bool

Show self and only returns when the user finished interacting with it (either validating choices or canceling).

set_ok_label(ok_label)
Parameters:

ok_label (str) – a label to replace the OK button’s text.

Changes the “OK” button’s label of self to ok_label.

set_sensitive(property, sensitive, config, config_property, config_invert)
Parameters:
  • property (str) – name of a property of the Gimp.Procedure self has been created for.

  • sensitive (bool) – whether the widget associated to property should be sensitive.

  • config (GObject.Object or None) – an optional config object.

  • config_property (str or None) – name of a property of config.

  • config_invert (bool) – whether to negate the value of config_property.

Sets sensitivity of the widget associated to property in self. If config is None, then it is set to the value of sensitive. Otherwise sensitive is ignored and sensitivity is bound to the value of config_property of config (or the negation of this value if config_reverse is True).

set_sensitive_if_in(property, config, config_property, values, in_values)
Parameters:
  • property (str) – name of a property of the Gimp.Procedure self has been created for.

  • config (GObject.Object or None) – an optional config object (if None, property's config will be used).

  • config_property (str) – name of a property of config.

  • values (Gimp.ValueArray) – an array of GValues which could be values of config_property.

  • in_values (bool) – whether property should be sensitive when config_property is one of values, or the opposite.

Sets sensitivity of the widget associated to property in self if the value of config_property in config is equal to one of values.

If config is None, then the configuration object of self is used.

If in_values is False, then the widget is set sensitive if the value of config_property is **not** in values.

do_fill_end(procedure, config) virtual
Parameters:
do_fill_start(procedure, config) virtual
Parameters:

Property Details

GimpUi.ProcedureDialog.props.config
Name:

config

Type:

Gimp.ProcedureConfig

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT

The Gimp.ProcedureConfig this dialog is editing

GimpUi.ProcedureDialog.props.procedure
Name:

procedure

Type:

Gimp.Procedure

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The Gimp.Procedure this dialog is used with