Callbacks

HelpFunc (help_id, help_data)

ImageConstraintFunc (image, *data)

IntRadioFrameSensitivityFunc (value, user_data, new_value, *data)

IntSensitivityFunc (value, *data)

ItemConstraintFunc (image, item, *data)

QueryBooleanCallback (query_box, value, *data)

QueryDoubleCallback (query_box, value, *data)

QueryIntCallback (query_box, value, *data)

QuerySizeCallback (query_box, size, unit, *data)

QueryStringCallback (query_box, string, *data)

StringSensitivityFunc (id, *data)

Details

GimpUi.HelpFunc(help_id, help_data)
Parameters:
  • help_id (str) – the help ID

  • help_data (object or None) – the help user data

This is the prototype for all functions you pass as help_func to the various GIMP dialog constructors like gimp_dialog_new(), GimpUi.query_int_box() etc.

Help IDs are textual identifiers the help system uses to figure which page to display.

All these dialog constructors functions call GimpUi.help_connect().

In most cases it will be ok to use GimpUi.standard_help_func() which does nothing but passing the help_id string to Gimp.help(). If your plug-in needs some more sophisticated help handling you can provide your own help_func which has to call Gimp.help() to actually display the help.

GimpUi.ImageConstraintFunc(image, *data)
Parameters:
Return type:

bool

GimpUi.IntRadioFrameSensitivityFunc(value, user_data, new_value, *data)
Parameters:
Returns:

True if the button stays sensitive, False otherwise.

Return type:

bool

Signature for a function called on each radio button value and data, each time the GimpUi.IntRadioFrame is drawn, to make some radio button insensitive. If the function returns False, it usually means that the value is not a valid choice in current situation. In this case, you might want to toggle instead another value automatically. Set new_value to the value to toggle. If you leave this untouched, the radio button will stay toggled despite being insensitive. This is up to you to decide whether this is meaningful.

GimpUi.IntSensitivityFunc(value, *data)
Parameters:
Return type:

bool

GimpUi.ItemConstraintFunc(image, item, *data)
Parameters:
Return type:

bool

GimpUi.QueryBooleanCallback(query_box, value, *data)
Parameters:
  • query_box (Gtk.Widget) – The query box.

  • value (bool) – The entered boolean value.

  • data (object or None) – user data.

The callback for a boolean query box.

GimpUi.QueryDoubleCallback(query_box, value, *data)
Parameters:

The callback for a double query box.

GimpUi.QueryIntCallback(query_box, value, *data)
Parameters:
  • query_box (Gtk.Widget) – The query box.

  • value (int) – The entered integer value.

  • data (object or None) – user data.

The callback for an int query box.

GimpUi.QuerySizeCallback(query_box, size, unit, *data)
Parameters:
  • query_box (Gtk.Widget) – The query box.

  • size (float) – The entered size in pixels.

  • unit (Gimp.Unit) – The selected unit from the #GimpUnitMenu.

  • data (object or None) – user data.

The callback for a size query box.

GimpUi.QueryStringCallback(query_box, string, *data)
Parameters:
  • query_box (Gtk.Widget) – The query box.

  • string (str) – The entered string.

  • data (object or None) – user data.

Note that you must not GLib.free() the passed string.

GimpUi.StringSensitivityFunc(id, *data)
Parameters:
  • id (str) – the string value from the column id_column as passed to [ctor`StringComboBox`.new].

  • data (object or None) – the data passed in [method`StringComboBox`.set_sensitivity].

Return type:

bool