Functions¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- GimpUi.cairo_set_focus_line_pattern(cr, widget)¶
- Parameters:
cr (
cairo.Context) – Cairo contextwidget (
Gtk.Widget) – widget to draw the focus indicator on
- Returns:
Trueif the widget style has a focus line pattern,Falseotherwise- Return type:
Sets color and dash pattern for stroking a focus line on the given cr. The line pattern is taken from widget.
New in version 2.6.
- GimpUi.cairo_set_source_color(cr, color, config, softproof, widget)¶
- Parameters:
cr (
cairo.Context) – Cairo context.color (
Gegl.Color) – the [class`Gegl`.Color] to use as source pattern within cr.config (
Gimp.ColorConfig) – the color management settings.softproof (
bool) – whether the color must also be soft-proofed.widget (
Gtk.WidgetorNone) – [class`Gtk`.Widget] to draw the focus indicator on.
Sets color as the source pattern within cr, taking into account the profile of the [class`Gdk`.Monitor] which widget is displayed on.
If config is set, the color configuration as set by the user will be used, in particular using any custom monitor profile set in preferences (overriding system-set profile). If no such custom profile is set, it will use the profile of the monitor widget is displayed on and will default to sRGB if widget is
None.Use [func`Gimp`.get_color_configuration] to retrieve the user [class`Gimp`.ColorConfig].
TODO: softproof is currently unused.
New in version 3.0.
- GimpUi.cairo_surface_create_from_pixbuf(pixbuf)¶
- Parameters:
pixbuf (
GdkPixbuf.Pixbuf) – aGdkPixbuf.Pixbuf- Returns:
- Return type:
Create a Cairo image surface from a
GdkPixbuf.Pixbuf.You should avoid calling this function as there are probably more efficient ways of achieving the result you are looking for.
New in version 2.6.
- GimpUi.context_help(widget)¶
- Parameters:
widget (
Gtk.Widget) – AnyGtk.Widgeton the screen.
This function invokes the context help inspector.
The mouse cursor will turn turn into a question mark and the user can click on any widget of the application which started the inspector.
If the widget the user clicked on has a help_id string attached (see
GimpUi.help_set_help_data()), the corresponding help page will be displayed. Otherwise the help system will ascend the widget hierarchy until it finds an attached help_id string (which should be the case at least for every window/dialog).
- GimpUi.coordinates_new(unit, unit_format, menu_show_pixels, menu_show_percent, spinbutton_width, update_policy, chainbutton_active, chain_constrains_ratio, xlabel, x, xres, lower_boundary_x, upper_boundary_x, xsize_0, xsize_100, ylabel, y, yres, lower_boundary_y, upper_boundary_y, ysize_0, ysize_100)¶
- Parameters:
unit (
Gimp.Unit) – The initial unit of the #GimpUnitMenu.unit_format (
str) – A printf-like unit-format string as is used with gimp_unit_menu_new().menu_show_pixels (
bool) –Trueif the #GimpUnitMenu should contain an item forGimp.UnitID.PIXEL.menu_show_percent (
bool) –Trueif the #GimpUnitMenu should contain an item forGimp.UnitID.PERCENT.spinbutton_width (
int) – The horizontal size of theGimpUi.SizeEntry'sGtk.SpinButton's.update_policy (
GimpUi.SizeEntryUpdatePolicy) – The update policy for theGimpUi.SizeEntry.chainbutton_active (
bool) –Trueif the attachedGimpUi.ChainButtonshould be active.chain_constrains_ratio (
bool) –Trueif the chainbutton should constrain the fields’ aspect ratio. IfFalse, the values will be constrained.xlabel (
str) – The label for the X coordinate.x (
float) – The initial value of the X coordinate.xres (
float) – The horizontal resolution in DPI.lower_boundary_x (
float) – The lower boundary of the X coordinate.upper_boundary_x (
float) – The upper boundary of the X coordinate.xsize_0 (
float) – The X value which will be treated as 0%.xsize_100 (
float) – The X value which will be treated as 100%.ylabel (
str) – The label for the Y coordinate.y (
float) – The initial value of the Y coordinate.yres (
float) – The vertical resolution in DPI.lower_boundary_y (
float) – The lower boundary of the Y coordinate.upper_boundary_y (
float) – The upper boundary of the Y coordinate.ysize_0 (
float) – The Y value which will be treated as 0%.ysize_100 (
float) – The Y value which will be treated as 100%.
- Returns:
The new
GimpUi.SizeEntry.- Return type:
Convenience function that creates a
GimpUi.SizeEntrywith two fields for x/y coordinates/sizes with aGimpUi.ChainButtonattached to constrain either the two fields’ values or the ratio between them.
- GimpUi.double_adjustment_update(adjustment)¶
- Parameters:
adjustment (
Gtk.Adjustment) – AGtk.Adjustment.- Returns:
A return location for the adjustment's value.
- Return type:
data:
float
- GimpUi.enum_icon_box_new(enum_type, icon_prefix, icon_size, callback, *callback_data)¶
- Parameters:
enum_type (
GObject.GType) – theGObject.GTypeof an enum.icon_prefix (
str) – the prefix of the group of icon names to use.icon_size (
Gtk.IconSize) – the icon size for the iconscallback (
GObject.CallbackorNone) – a callback to connect to the “toggled” signal of eachGtk.RadioButtonthat is created.callback_data (
objectorNone) – data to pass to the callback.
- Returns:
a new horizontal
Gtk.Boxholding a group ofGtk.RadioButtons.- first_button:
Returns the first button in the created group.
- Return type:
(
Gtk.Widget, first_button:Gtk.Widget)
Creates a horizontal box of radio buttons with named icons. The icon name for each icon is created by appending the enum_value’s nick to the given icon_prefix.
New in version 2.10.
- GimpUi.enum_icon_box_new_with_range(enum_type, minimum, maximum, icon_prefix, icon_size, callback, *callback_data)¶
- Parameters:
enum_type (
GObject.GType) – theGObject.GTypeof an enum.minimum (
int) – the minumim enum valuemaximum (
int) – the maximum enum valueicon_prefix (
str) – the prefix of the group of icon names to use.icon_size (
Gtk.IconSize) – the icon size for the iconscallback (
GObject.CallbackorNone) – a callback to connect to the “toggled” signal of eachGtk.RadioButtonthat is created.callback_data (
objectorNone) – data to pass to the callback.
- Returns:
a new horizontal
Gtk.Boxholding a group ofGtk.RadioButtons.- first_button:
Returns the first button in the created group.
- Return type:
(
Gtk.Widget, first_button:Gtk.Widget)
Just like
GimpUi.enum_icon_box_new(), this function creates a group of radio buttons, but additionally it supports limiting the range of available enum values.New in version 2.10.
- GimpUi.enum_icon_box_set_child_padding(icon_box, xpad, ypad)¶
- Parameters:
icon_box (
Gtk.Widget) – an icon box widgetxpad (
int) – horizontal paddingypad (
int) – vertical padding
Sets the padding of all buttons in a box created by
GimpUi.enum_icon_box_new().New in version 2.10.
- GimpUi.enum_icon_box_set_icon_size(icon_box, icon_size)¶
- Parameters:
icon_box (
Gtk.Widget) – an icon box widgeticon_size (
Gtk.IconSize) – theGtk.IconSizeenum
Sets the icon size of all buttons in a box created by
GimpUi.enum_icon_box_new().New in version 3.0.
- GimpUi.enum_radio_box_new(enum_type, callback, *callback_data)¶
- Parameters:
enum_type (
GObject.GType) – theGObject.GTypeof an enum.callback (
GObject.CallbackorNone) – a callback to connect to the “toggled” signal of eachGtk.RadioButtonthat is created.callback_data (
objectorNone) – data to pass to the callback.
- Returns:
a new
Gtk.Boxholding a group ofGtk.RadioButtons.- first_button:
Returns the first button in the created group.
- Return type:
(
Gtk.Widget, first_button:Gtk.Widget)
Creates a new group of
Gtk.RadioButtonsrepresenting the enum values. A group of radiobuttons is a good way to represent enums with up to three or four values. Often it is better to use aGimpUi.EnumComboBoxinstead.New in version 2.4.
- GimpUi.enum_radio_box_new_with_range(enum_type, minimum, maximum, callback, *callback_data)¶
- Parameters:
enum_type (
GObject.GType) – theGObject.GTypeof an enum.minimum (
int) – the minimum enum valuemaximum (
int) – the maximum enum valuecallback (
GObject.CallbackorNone) – a callback to connect to the “toggled” signal of eachGtk.RadioButtonthat is created.callback_data (
objectorNone) – data to pass to the callback.
- Returns:
a new vertical
Gtk.Boxholding a group ofGtk.RadioButtons- first_button:
Returns the first button in the created group.
- Return type:
(
Gtk.Widget, first_button:Gtk.Widget)
Just like
GimpUi.enum_radio_box_new(), this function creates a group of radio buttons, but additionally it supports limiting the range of available enum values.New in version 2.4.
- GimpUi.enum_radio_frame_new(enum_type, label_widget, callback, *callback_data)¶
- Parameters:
enum_type (
GObject.GType) – theGObject.GTypeof an enum.label_widget (
Gtk.WidgetorNone) – aGtk.Widgetto use as label for the frame that will hold the radio box.callback (
GObject.CallbackorNone) – a callback to connect to the “toggled” signal of eachGtk.RadioButtonthat is created.callback_data (
objectorNone) – data to pass to the callback.
- Returns:
a new
Gtk.Frameholding a group ofGtk.RadioButtons.- first_button:
Returns the first button in the created group.
- Return type:
(
Gtk.Widget, first_button:Gtk.Widget)
Calls
GimpUi.enum_radio_box_new() and puts the resulting vbox into aGtk.Frame.New in version 2.4.
- GimpUi.enum_radio_frame_new_with_range(enum_type, minimum, maximum, label_widget, callback, *callback_data)¶
- Parameters:
enum_type (
GObject.GType) – theGObject.GTypeof an enum.minimum (
int) – the minimum enum valuemaximum (
int) – the maximum enum valuelabel_widget (
Gtk.WidgetorNone) – a widget to put into the frame that will hold the radio box.callback (
GObject.CallbackorNone) – a callback to connect to the “toggled” signal of eachGtk.RadioButtonthat is created.callback_data (
objectorNone) – data to pass to the callback.
- Returns:
a new
Gtk.Frameholding a group ofGtk.RadioButtons.- first_button:
Returns the first button in the created group.
- Return type:
(
Gtk.Widget, first_button:Gtk.Widget)
Calls
GimpUi.enum_radio_box_new_with_range() and puts the resulting vertical box into aGtk.Frame.New in version 2.4.
- Parameters:
- Returns:
Trueif the event should trigger a context menu.- Return type:
Alternative of
Gdk.Event.triggers_context_menu() with the additional feature of allowing a menu triggering to happen on a button release event. All the other rules on whether event should trigger a contextual menu are exactly the same. Only the swapping to release state as additional feature is different.New in version 3.0.
- GimpUi.float_adjustment_update(adjustment)¶
- Parameters:
adjustment (
Gtk.Adjustment) – AGtk.Adjustment.- Returns:
A return location for the adjustment's value.
- Return type:
data:
float
- GimpUi.get_monitor_at_pointer()¶
- Returns:
the
Gdk.Monitorwhere the pointer is.- Return type:
- GimpUi.grid_attach_aligned(grid, left, top, label_text, label_xalign, label_yalign, widget, widget_columns)¶
- Parameters:
grid (
Gtk.Grid) – TheGtk.Gridthe widgets will be attached to.left (
int) – The column to start with.top (
int) – The row to attach the widgets.label_text (
str) – The text for theGtk.Labelwhich will be attached left of the widget.label_xalign (
float) – The horizontal alignment of theGtk.Label.label_yalign (
float) – The vertical alignment of theGtk.Label.widget (
Gtk.Widget) – TheGtk.Widgetto attach right of the label.widget_columns (
int) – The number of columns the widget will use.
- Returns:
The created
Gtk.Label.- Return type:
Note that the label_text can be
Noneand that the widget will be attached starting at (column + 1) in this case, too.
- GimpUi.help_connect(widget, tooltip, help_func, help_id, *help_data)¶
- Parameters:
widget (
Gtk.Widget) – The widget you want to connect the help accelerator for. Will be aGtk.Windowin most cases.tooltip (
strorNone) – The text for this widget’s tooltip. For windows, you usually want to setNone.help_func (
GimpUi.HelpFunc) – The function which will be called if the user presses “F1”.help_id (
str) – The help_id which will be passed to help_func.help_data (
objectorNone) – The help_data pointer which will be passed to help_func.
Note that this function is automatically called by all libgimp dialog constructors. You only have to call it for windows/dialogs you created “manually”.
Most of the time, what you want to call for non-windows widgets is simply [func`GimpUi`.help_set_help_data]. Yet if you need to set up an help_func, call
gimp_help_connectinstead. Note thatgimp_help_set_help_datais implied, so you don’t have to call it too.
- GimpUi.help_id_quark()¶
- Returns:
The #GQuark.
- Return type:
This function returns the #GQuark which should be used as key when attaching help IDs to widgets and objects.
New in version 2.2.
- GimpUi.help_set_help_data(widget, tooltip, help_id)¶
- Parameters:
widget (
Gtk.Widget) – TheGtk.Widgetyou want to set a tooltip and/or help_id for.tooltip (
strorNone) – The text for this widget’s tooltip (orNone).help_id (
str) – The help_id for the #GtkTipsQuery tooltips inspector.
The reason why we don’t use
Gtk.Widget.set_tooltip_text() is that elements in the GIMP user interface should, if possible, also have a help_id set for context-sensitive help.This function can be called with
Nonefor tooltip. Use this feature if you want to set a help link for a widget which shouldn’t have a visible tooltip.
- GimpUi.help_set_help_data_with_markup(widget, tooltip, help_id)¶
- Parameters:
widget (
Gtk.Widget) – TheGtk.Widgetyou want to set a tooltip and/or help_id for.tooltip (
str) – The markup for this widget’s tooltip (orNone).help_id (
str) – The help_id for the #GtkTipsQuery tooltips inspector.
Just like
GimpUi.help_set_help_data(), but supports to pass text which is marked up with Pango text markup language.New in version 2.6.
- GimpUi.icons_init()¶
Initializes the GIMP stock icon factory.
You don’t need to call this function as
GimpUi.init() already does this for you.
- GimpUi.init(prog_name)¶
- Parameters:
prog_name (
str) – The name of the plug-in which will be passed as argv[0] togtk_init(). It’s a convention to use the name of the executable and _not_ the PDB procedure name.
This function initializes GTK with [func`Gtk`.init], as well as GEGL and babl.
It also sets up various other things so that the plug-in user looks and behaves like the GIMP core. This includes selecting the GTK theme and setting up the help system as chosen in GIMP preferences. Any plug-in that provides a user interface should call this function.
It can safely be called more than once. Calls after the first return quickly with no effect.
- GimpUi.int_adjustment_update(adjustment)¶
- Parameters:
adjustment (
Gtk.Adjustment) – AGtk.Adjustment.- Returns:
A return location for the adjustment's value.
- Return type:
data:
int
Note that the
Gtk.Adjustment's value (which is afloat) will be rounded with RINT().
- GimpUi.int_radio_group_set_active(radio_button, item_data)¶
- Parameters:
radio_button (
Gtk.RadioButton) – Pointer to aGtk.RadioButton.item_data (
int) – The item_data of the radio button you want to select.
Calls
Gtk.ToggleButton.set_active() with the radio button that was created with a matching item_data. This function does the same thing as gimp_radio_group_set_active(), but takes integers as item_data instead of pointers.
- GimpUi.monitor_get_color_profile(monitor)¶
- Parameters:
monitor (
Gdk.Monitor) – aGdk.Monitor- Returns:
the monitor’s
Gimp.ColorProfile, orNone.- Return type:
This function returns the
Gimp.ColorProfileof monitor orNoneif there is no profile configured.New in version 3.0.
- GimpUi.proc_view_new(procedure_name)¶
- Parameters:
procedure_name (
str) – The name of a procedure.- Returns:
a new widget providing a view on a GIMP procedure
- Return type:
New in version 2.4.
- GimpUi.prop_boolean_combo_box_new(config, property_name, true_text, false_text)¶
- Parameters:
- Returns:
The newly created
Gtk.ComboBoxwidget.- Return type:
Creates a
Gtk.ComboBoxwidget to display and set the specified boolean property. The combo box will have two entries, one displaying the true_text label, the other displaying the false_text label.New in version 2.4.
- GimpUi.prop_boolean_radio_frame_new(config, property_name, title, true_text, false_text)¶
- Parameters:
- Returns:
A
GimpUi.Framecontaining the radio buttons.- Return type:
Creates a pair of radio buttons which function to set and display the specified boolean property. If title is
None, the property_name's nick will be used as label of the returned frame.New in version 2.4.
- GimpUi.prop_brush_chooser_new(config, property_name, chooser_title)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of a [class`Gimp`.Brush] property.chooser_title (
strorNone) – title for the poppable dialog.
- Returns:
A new [class`GimpUi`.BrushChooser].
- Return type:
Creates a [class`GimpUi`.BrushChooser] controlled by the specified property.
New in version 3.0.
- GimpUi.prop_check_button_new(config, property_name, label)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of boolean property controlled by checkbutton.label (
strorNone) – Label to give checkbutton (including mnemonic).
- Returns:
The newly created
Gtk.CheckButtonwidget.- Return type:
Creates a
Gtk.CheckButtonthat displays and sets the specified boolean property. If label isNone, the property_name's nick will be used as label of the returned button.New in version 2.4.
- GimpUi.prop_choice_combo_box_new(config, property_name)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name ofGimp.Choiceproperty controlled by combo box.
- Returns:
The newly created
GimpUi.StringComboBoxwidget.- Return type:
Creates a
GimpUi.StringComboBoxwidget to display and set the specified property.
- GimpUi.prop_choice_radio_frame_new(config, property_name)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name ofGimp.Choiceproperty controlled by radio buttons.
- Returns:
The newly created
GimpUi.IntRadioFramewidget.- Return type:
Creates a [class`GimpUi`.IntRadioFrame] widget to display and set the specified [class`Gimp`.Choice] property.
- GimpUi.prop_color_area_new(config, property_name, width, height, type)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name ofGegl.Colorproperty.width (
int) – Width of color area.height (
int) – Height of color area.type (
GimpUi.ColorAreaType) – How transparency is represented.
- Returns:
A new
GimpUi.ColorAreawidget.- Return type:
Creates a
GimpUi.ColorAreato set and display the value of an RGB property.New in version 2.4.
- GimpUi.prop_color_select_new(config, property_name, width, height, type)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of [class`Gegl`.Color] property.width (
int) – Width of the colorpreview in pixels.height (
int) – Height of the colorpreview in pixels.type (
GimpUi.ColorAreaType) – How transparency is represented.
- Returns:
A new
GimpUi.ColorButtonwidget.- Return type:
Creates a
GimpUi.ColorButtonto set and display the value of a color property.New in version 3.0.
- GimpUi.prop_coordinates_connect(config, x_property_name, y_property_name, unit_property_name, sizeentry, chainbutton, xresolution, yresolution)¶
- Parameters:
config (
GObject.Object) –x_property_name (
str) –y_property_name (
str) –unit_property_name (
str) –sizeentry (
Gtk.Widget) –chainbutton (
Gtk.Widget) –xresolution (
float) –yresolution (
float) –
- Return type:
- GimpUi.prop_coordinates_new(config, x_property_name, y_property_name, unit_property_name, unit_format, update_policy, xresolution, yresolution, has_chainbutton)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.x_property_name (
str) – Name of int or double property for X coordinate.y_property_name (
str) – Name of int or double property for Y coordinate.unit_property_name (
str) – Name of unit property.unit_format (
str) – A printf-like unit-format string as is used with gimp_unit_menu_new().update_policy (
GimpUi.SizeEntryUpdatePolicy) – How the automatic pixel <-> real-world-unit calculations should be done.xresolution (
float) – The resolution (in dpi) for the X coordinate.yresolution (
float) – The resolution (in dpi) for the Y coordinate.has_chainbutton (
bool) – Whether to add a chainbutton to the size entry.
- Returns:
A new
GimpUi.SizeEntrywidget.- Return type:
Creates a
GimpUi.SizeEntryto set and display two double or int properties, which will usually represent X and Y coordinates, and their associated unit property.If unit_format is
None, the unit will default to inch. Otherwise it must be the name of a property of typeGimp.ParamUnit:New in version 2.4.
- GimpUi.prop_drawable_chooser_new(config, property_name, chooser_title)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of a [class`Gimp`.Drawable] property.chooser_title (
strorNone) – title for the poppable dialog.
- Returns:
A new [class`GimpUi`.DrawableChooser].
- Return type:
Creates a [class`GimpUi`.DrawableChooser] controlled by the specified property.
New in version 3.0.
Deprecated since version 3.2: Use
GimpUi.prop_item_chooser_new().
- GimpUi.prop_entry_new(config, property_name, max_len)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of string property.max_len (
int) – Maximum allowed length of string.
- Returns:
A new
Gtk.Entrywidget.- Return type:
Creates a
Gtk.Entryto set and display the value of the specified string property.New in version 2.4.
- GimpUi.prop_enum_check_button_new(config, property_name, label, false_value, true_value)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of enum property controlled by checkbutton.label (
strorNone) – Label to give checkbutton (including mnemonic).false_value (
int) – Enum value corresponding to unchecked state.true_value (
int) – Enum value corresponding to checked state.
- Returns:
The newly created
Gtk.CheckButtonwidget.- Return type:
Creates a
Gtk.CheckButtonthat displays and sets the specified property of type Enum. Note that this widget only allows two values for the enum, one corresponding to the “checked” state and the other to the “unchecked” state. If label isNone, the property_name's nick will be used as label of the returned button.New in version 2.4.
- GimpUi.prop_enum_combo_box_new(config, property_name, minimum, maximum)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of enum property controlled by combo box.minimum (
int) – Smallest allowed value of enum.maximum (
int) – Largest allowed value of enum.
- Returns:
The newly created
GimpUi.EnumComboBoxwidget.- Return type:
Creates a
GimpUi.IntComboBoxwidget to display and set the specified enum property. The mimimum_value and maximum_value give the possibility of restricting the allowed range to a subset of the enum. If the two values are equal (e.g., 0, 0), then the full range of the Enum is used.New in version 2.4.
- GimpUi.prop_enum_icon_box_new(config, property_name, icon_prefix, minimum, maximum)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of enum property controlled by the radio buttons.icon_prefix (
str) – The prefix of the group of icon names to use.minimum (
int) – Smallest value of enum to be included.maximum (
int) – Largest value of enum to be included.
- Returns:
A #libgimpwidgets-gimpenumiconbox containing the radio buttons.
- Return type:
Creates a horizontal box of radio buttons with named icons, which function to set and display the value of the specified Enum property. The icon name for each icon is created by appending the enum_value’s nick to the given icon_prefix. See
GimpUi.enum_icon_box_new() for more information.New in version 2.10.
- GimpUi.prop_enum_label_new(config, property_name)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of enum property to be displayed.
- Returns:
The newly created
GimpUi.EnumLabelwidget.- Return type:
New in version 2.4.
- GimpUi.prop_enum_radio_box_new(config, property_name, minimum, maximum)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of enum property controlled by the radio buttons.minimum (
int) – Smallest value of enum to be included.maximum (
int) – Largest value of enum to be included.
- Returns:
A
Gtk.Boxcontaining the radio buttons.- Return type:
Creates a group of radio buttons which function to set and display the specified enum property. The minimum and maximum arguments allow only a subset of the enum to be used. If the two arguments are equal (e.g., 0, 0), then the full range of the enum will be used. If you want to assign a label to the group of radio buttons, use
GimpUi.prop_enum_radio_frame_new() instead of this function.New in version 2.4.
- GimpUi.prop_enum_radio_frame_new(config, property_name, title, minimum, maximum)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of enum property controlled by the radio buttons.title (
strorNone) – Label for the frame holding the buttonsminimum (
int) – Smallest value of enum to be included.maximum (
int) – Largest value of enum to be included.
- Returns:
A
GimpUi.Framecontaining the radio buttons.- Return type:
Creates a group of radio buttons which function to set and display the specified enum property. The minimum and maximum arguments allow only a subset of the enum to be used. If the two arguments are equal (e.g., 0, 0), then the full range of the enum will be used. If title is
None, the property_name's nick will be used as label of the returned frame.New in version 2.4.
- GimpUi.prop_expander_new(config, property_name, label)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of boolean property.
- Returns:
A new
Gtk.Expanderwidget.- Return type:
Creates a
Gtk.Expandercontrolled by the specified boolean property. A value ofTruefor the property corresponds to the expanded state for the widget. If label isNone, the property_name's nick will be used as label of the returned widget.New in version 2.4.
- GimpUi.prop_file_chooser_button_new(config, property_name, title, action)¶
- Parameters:
config (
GObject.Object) – object to which property is attached.property_name (
str) – name of path property.action (
Gtk.FileChooserAction) – the open mode for the widget.
- Returns:
A new
Gtk.FileChooserButton.- Return type:
Creates a
Gtk.FileChooserButtonto edit the specified path property. property_name must represent either a GIMP_PARAM_SPEC_CONFIG_PATH or a G_PARAM_SPEC_OBJECT wherevalue_type == G_TYPE_FILE.Note that
Gtk.FileChooserButtonimplements theGtk.FileChooserinterface; you can use theGtk.FileChooserAPI with it.New in version 2.4.
- GimpUi.prop_file_chooser_button_new_with_dialog(config, property_name, dialog)¶
- Parameters:
config (
GObject.Object) – object to which property is attached.property_name (
str) – name of path property.dialog (
Gtk.Widget) – theGtk.FileChooserDialogwidget to use.
- Returns:
A new
Gtk.FileChooserButton.- Return type:
Creates a
Gtk.FileChooserButtonto edit the specified path property.The button uses dialog as it’s file-picking window. Note that dialog must be a
Gtk.FileChooserDialog(or subclass) and must not haveGtk.DialogFlags.DESTROY_WITH_PARENTset.Note that
Gtk.FileChooserButtonimplements theGtk.FileChooserinterface; you can use theGtk.FileChooserAPI with it.New in version 2.4.
- GimpUi.prop_file_chooser_new(config, property_name, label, title)¶
- Parameters:
- Returns:
A new
Gtk.FileChooserButton.- Return type:
Creates a [class`GimpUi`.FileChooser] to edit the specified file property. property_name must be a %GimpParamSpecFile with an action other than [enum`Gimp`.FileChooserAction.ANY].
If label is
None, property_name'snicktext will be used instead.New in version 3.0.
- GimpUi.prop_font_chooser_new(config, property_name, chooser_title)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of a [class`Gimp`.Font] property.chooser_title (
strorNone) – title for the poppable dialog.
- Returns:
A new [class`GimpUi`.FontChooser].
- Return type:
Creates a [class`GimpUi`.FontChooser] controlled by the specified property.
New in version 3.0.
- GimpUi.prop_gradient_chooser_new(config, property_name, chooser_title)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of a [class`Gimp`.Gradient] property.chooser_title (
strorNone) – title for the poppable dialog.
- Returns:
A new [class`GimpUi`.GradientChooser].
- Return type:
Creates a [class`GimpUi`.GradientChooser] controlled by the specified property.
New in version 3.0.
- GimpUi.prop_hscale_new(config, property_name, step_increment, page_increment, digits)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of integer or double property controlled by the scale.step_increment (
float) – Step size.page_increment (
float) – Page size.digits (
int) – Number of digits after decimal point to display.
- Returns:
A new
Gtk.Scale.- Return type:
Creates a horizontal scale to control the value of the specified integer or double property.
New in version 2.4.
- GimpUi.prop_icon_image_new(config, property_name, icon_size)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of string property.icon_size (
Gtk.IconSize) – Size of desired icon image.
- Returns:
A new
Gtk.Imagewidget.- Return type:
Creates a widget to display a icon image representing the value of the specified string property, which should encode an icon name. See
Gtk.Image.new_from_icon_name() for more information.New in version 2.10.
- GimpUi.prop_image_chooser_new(config, property_name, chooser_title)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of a [class`Gimp`.Image] property.chooser_title (
strorNone) – title for the poppable dialog.
- Returns:
A new [class`GimpUi`.ImageChooser].
- Return type:
Creates a [class`GimpUi`.ImageChooser] controlled by the specified property.
New in version 3.0.
- GimpUi.prop_int_combo_box_new(config, property_name, store)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of int property controlled by combo box.store (
GimpUi.IntStore) –GimpUi.IntStoreholding list of labels, values, etc.
- Returns:
The newly created
GimpUi.IntComboBoxwidget.- Return type:
Creates a
GimpUi.IntComboBoxwidget to display and set the specified property. The contents of the widget are determined by store, which should be created usingGimpUi.IntStore.new().New in version 2.4.
- GimpUi.prop_int_radio_frame_new(config, property_name, title, store)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of enum property controlled by the radio buttons.title (
strorNone) – Label for the frame holding the buttonsstore (
GimpUi.IntStore) –GimpUi.IntStoreholding list of labels, values, etc.
- Returns:
A
GimpUi.Framecontaining the radio buttons.- Return type:
Creates a group of radio buttons which function to set and display the specified int property. If title is
None, the property_name's nick will be used as label of the returned frame.New in version 3.0.
- GimpUi.prop_item_chooser_new(config, property_name, chooser_title)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of a [class`Gimp`.Item] property.chooser_title (
strorNone) – title for the poppable dialog.
- Returns:
A new [class`GimpUi`.ItemChooser].
- Return type:
Creates a [class`GimpUi`.ItemChooser] controlled by the specified property.
New in version 3.2.
- GimpUi.prop_label_color_new(config, property_name, editable)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of RGB property.editable (
bool) – Whether the widget should allow color editability.
- Returns:
A new
GimpUi.LabelColorwidget.- Return type:
Creates a
GimpUi.LabelColorto set and display the value of an RGB property.New in version 3.0.
- GimpUi.prop_label_entry_new(config, property_name, max_len)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of string property.max_len (
int) – Maximum allowed length of string (set to negative for no maximum).
- Returns:
A new
Gtk.Entrywidget.- Return type:
Creates a
GimpUi.LabelEntryto set and display the value of the specified string property.New in version 3.0.
- GimpUi.prop_label_new(config, property_name)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of string property.
- Returns:
A new
Gtk.Labelwidget.- Return type:
Creates a
Gtk.Labelto display the value of the specified property. The property should be a string property or at least transformable to a string. If the user should be able to edit the string, useGimpUi.prop_entry_new() instead.New in version 2.4.
- GimpUi.prop_label_spin_new(config, property_name, digits)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) –digits (
int) – Number of digits after decimal point to display.
- Returns:
A new #libgimpwidgets-gimpspinbutton.
- Return type:
Creates a
GimpUi.LabelSpinto set and display the value of the specified double property.New in version 2.4.
- GimpUi.prop_memsize_entry_new(config, property_name)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of memsize property.
- Returns:
A new
GimpUi.MemsizeEntry.- Return type:
Creates a
GimpUi.MemsizeEntry(spin button and option menu) to set and display the value of the specified memsize property. SeeGimpUi.MemsizeEntry.new() for more information.New in version 2.4.
- GimpUi.prop_palette_chooser_new(config, property_name, chooser_title)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of a [class`Gimp`.Palette] property.chooser_title (
strorNone) – title for the poppable dialog.
- Returns:
A new [class`GimpUi`.PaletteChooser].
- Return type:
Creates a [class`GimpUi`.PaletteChooser] controlled by the specified property.
New in version 3.0.
- GimpUi.prop_path_editor_new(config, path_property_name, writable_property_name, filechooser_title)¶
- Parameters:
config (
GObject.Object) – object to which property is attached.path_property_name (
str) – name of path property.writable_property_name (
str) – name of writable path property.filechooser_title (
str) – window title ofGtk.FileChooserDialogwidget.
- Returns:
A new
GimpUi.PathEditor.- Return type:
Creates a
GimpUi.PathEditorto edit the specified path and writable path properties.
- GimpUi.prop_pattern_chooser_new(config, property_name, chooser_title)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of a [class`Gimp`.Pattern] property.chooser_title (
strorNone) – title for the poppable dialog.
- Returns:
A new [class`GimpUi`.PatternChooser].
- Return type:
Creates a [class`GimpUi`.PatternChooser] controlled by the specified property.
New in version 3.0.
- GimpUi.prop_pointer_combo_box_new(config, property_name, store)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name ofGObject.GType/objectproperty controlled by combo box.store (
GimpUi.IntStore) –GimpUi.IntStoreholding list of labels, values, etc.
- Returns:
The newly created
GimpUi.IntComboBoxwidget.- Return type:
Creates a
GimpUi.IntComboBoxwidget to display and set the specified property. The contents of the widget are determined by store, which should be created usingGimpUi.IntStore.new(). Values areGObject.GType/objectdata, and therefore must be stored in the “user-data” column, instead of the usual “value” column.New in version 2.10.
- GimpUi.prop_scale_entry_new(config, property_name, label, factor, limit_scale, lower_limit, upper_limit)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of integer or double property controlled by the scale.label (
strorNone) – The text for theGtk.Labelwhich will appear left of theGtk.Scale.factor (
float) – Optional multiplier to convert property_name's range into theGimpUi.ScaleEntry's range. The common usage is to set 1.0. For non-double properties, no other values than 1.0 are acceptable.limit_scale (
bool) –Falseif the range of possible values of theGtk.Scaleshould be the same as of theGtk.SpinButton.lower_limit (
float) – The scale’s lower boundary if scale_limits isTrue.upper_limit (
float) – The scale’s upper boundary if scale_limits isTrue.
- Returns:
The newly allocated
GimpUi.ScaleEntry.- Return type:
Creates a
GimpUi.ScaleEntry(slider and spin button) to set and display the value of a specified int or double property with sensible default settings depending on the range (decimal places, increments, etc.). These settings can be overridden by the relevant widget methods.If label is
None, the property_name's nick will be used as label of the returned object.If factor is not 1.0, the widget’s range will be computed based of property_name's range multiplied by factor. A typical usage would be to display a [0.0, 1.0] range as [0.0, 100.0] by setting 100.0 as factor.
See
GimpUi.ScaleEntry.set_bounds() for more information on limit_scale, lower_limit and upper_limit.New in version 2.4.
- GimpUi.prop_size_entry_new(config, property_name, property_is_pixel, unit_property_name, unit_format, update_policy, resolution)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of int or double property.property_is_pixel (
bool) – WhenTrue, the property value is in pixels, and in the selected unit otherwise.unit_property_name (
str) – Name of unit property.unit_format (
str) – A printf-like unit-format string as is used with gimp_unit_menu_new().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:
A new
GimpUi.SizeEntrywidget.- Return type:
Creates a
GimpUi.SizeEntryto set and display the specified double or int property, and its associated unit property. Note that this function is only suitable for creating a size entry holding a single value. UseGimpUi.prop_coordinates_new() to create a size entry holding two values.New in version 2.4.
- GimpUi.prop_spin_button_new(config, property_name, step_increment, page_increment, digits)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of double property controlled by the spin button.step_increment (
float) – Step size.page_increment (
float) – Page size.digits (
int) – Number of digits after decimal point to display.
- Returns:
A new #libgimpwidgets-gimpspinbutton.
- Return type:
Creates a spin button to set and display the value of the specified double property.
If you wish to change the widget’s range relatively to the property_name's range, use
GimpUi.prop_widget_set_factor().New in version 2.4.
- GimpUi.prop_spin_scale_new(config, property_name, step_increment, page_increment, digits)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of double or int property controlled by the spin button.step_increment (
float) – Step size.page_increment (
float) – Page size.digits (
int) – Number of digits after decimal point to display. This is only used for double properties. In case of int properties,digits = 0is implied.
- Returns:
A new #libgimpwidgets-gimpspinbutton.
- Return type:
Creates a spin scale to set and display the value of the specified int or double property.
By default, the property_name's nick will be used as label of the returned widget. Use
GimpUi.SpinScale.set_label() to change this.If you wish to change the widget’s range relatively to the property_name's range, use
GimpUi.prop_widget_set_factor().New in version 3.0.
- GimpUi.prop_string_combo_box_new(config, property_name, model, id_column, label_column)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of int property controlled by combo box.model (
Gtk.TreeModel) –Gtk.TreeStoreholding list of valuesid_column (
int) – column in store that holds string IDslabel_column (
int) – column in store that holds labels to use in the combo-box
- Returns:
The newly created
GimpUi.StringComboBoxwidget.- Return type:
Creates a
GimpUi.StringComboBoxwidget to display and set the specified property. The contents of the widget are determined by store.New in version 2.4.
- GimpUi.prop_switch_new(config, property_name, label)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of boolean property controlled by checkbutton.label (
str) – Label to give checkbutton (including mnemonic).
- Returns:
The newly created box containing a
Gtk.Switch.- label_out:
The generated
Gtk.Label- switch_out:
The generated
Gtk.Switch
- Return type:
(
Gtk.Widget, label_out:Gtk.Widget, switch_out:Gtk.Widget)
Creates a
Gtk.Boxwith a switch and a label that displays and sets the specified boolean property. If label isNone, the property_name's nick will be used as label.New in version 3.0.
- GimpUi.prop_text_buffer_new(config, property_name, max_len)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of string property.max_len (
int) – Maximum allowed length of text (in characters).
- Returns:
A new
Gtk.TextBuffer.- Return type:
Creates a
Gtk.TextBufferto set and display the value of the specified string property. Unless the string is expected to contain multiple lines or a large amount of text, useGimpUi.prop_entry_new() instead. SeeGtk.TextViewfor information on how to insert a text buffer into a visible widget.If max_len is 0 or negative, the text buffer allows an unlimited number of characters to be entered.
New in version 2.4.
- GimpUi.prop_toggle_new(config, property_name, icon_name, label)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of boolean property controlled by the toggle button.icon_name (
str) – Icon to display in the toggle.label (
str) – Label to give the toggle (including mnemonic).
- Returns:
The newly
Gtk.ToggleButton.- Return type:
(
Gtk.Widget, image_out:Gtk.Widget)
Creates a [class`Gtk`.ToggleButton] that sets the specified boolean property.
If icon_name is
None, label will be used. If label isNonetoo, the property_name's nick will be used as label.New in version 3.2.
- GimpUi.prop_unit_combo_box_new(config, property_name)¶
- Parameters:
config (
GObject.Object) – Object to which property is attached.property_name (
str) – Name of Unit property.
- Returns:
A new
GimpUi.UnitComboBoxwidget.- Return type:
Creates a
GimpUi.UnitComboBoxto set and display the value of a Unit property. SeeGimpUi.UnitComboBox.new() for more information.New in version 2.8.
- GimpUi.prop_widget_set_factor(widget, factor, step_increment, page_increment, digits)¶
- Parameters:
widget (
Gtk.Widget) – Property widget.factor (
float) – Multiplier to convert the widget's range and map appropriately to the property’s range it is associated to.step_increment (
float) – Step size.page_increment (
float) – Page size.digits (
int) – Number of digits after decimal point to display.
Change the display factor of the property widget relatively to the property it was bound to. Currently the only types of widget accepted as input are those created by
GimpUi.prop_spin_scale_new() andGimpUi.prop_spin_button_new().If factor is 1.0, then the config property and the widget display map exactly.
If factor is not 1.0, the widget’s range will be computed based of property_name's range multiplied by factor. A typical usage would be to display a [0.0, 1.0] range as [0.0, 100.0] by setting 100.0 as factor. This function can only be used with double properties.
The step_increment and page_increment can be set to new increments you want to get for this new range. If you set them to 0.0 or negative values, new increments will be computed based on the new factor and previous factor.
New in version 3.0.
- GimpUi.query_boolean_box(title, parent, help_func, help_id, icon_name, message, true_button, false_button, object, signal, callback, *data)¶
- Parameters:
title (
str) – The query box dialog’s title.parent (
Gtk.Widget) – The dialog’s parent widget.help_func (
GimpUi.HelpFunc) – The help function to show this dialog’s help page.help_id (
str) – A string identifying this dialog’s help page.icon_name (
str) – An icon name to specify an icon to appear on the left on the dialog’s message.message (
str) – A string which will be shown in the query box.true_button (
str) – The string to be shown in the dialog’s left button.false_button (
str) – The string to be shown in the dialog’s right button.object (
GObject.Object) – The object this query box is associated with.signal (
str) – The object’s signal which will cause the query box to be closed.callback (
GimpUi.QueryBooleanCallback) – The function which will be called when the user clicks one of the buttons.
- Returns:
A pointer to the new
Gtk.Dialog.- Return type:
Creates a new
Gtk.Dialogthat asks the user to do a boolean decision.
- GimpUi.query_double_box(title, parent, help_func, help_id, message, initial, lower, upper, digits, object, signal, callback, *data)¶
- Parameters:
title (
str) – The query box dialog’s title.parent (
Gtk.Widget) – The dialog’s parent widget.help_func (
GimpUi.HelpFunc) – The help function to show this dialog’s help page.help_id (
str) – A string identifying this dialog’s help page.message (
str) – A string which will be shown above the dialog’s entry widget.initial (
float) – The initial value.lower (
float) – The lower boundary of the range of possible values.upper (
float) – The upper boundray of the range of possible values.digits (
int) – The number of decimal digits theGtk.SpinButtonwill provide.object (
GObject.Object) – The object this query box is associated with.signal (
str) – The object’s signal which will cause the query box to be closed.callback (
GimpUi.QueryDoubleCallback) – The function which will be called when the user selects “OK”.
- Returns:
A pointer to the new
Gtk.Dialog.- Return type:
Creates a new
Gtk.Dialogthat queries the user for a double value.
- GimpUi.query_int_box(title, parent, help_func, help_id, message, initial, lower, upper, object, signal, callback, *data)¶
- Parameters:
title (
str) – The query box dialog’s title.parent (
Gtk.Widget) – The dialog’s parent widget.help_func (
GimpUi.HelpFunc) – The help function to show this dialog’s help page.help_id (
str) – A string identifying this dialog’s help page.message (
str) – A string which will be shown above the dialog’s entry widget.initial (
int) – The initial value.lower (
int) – The lower boundary of the range of possible values.upper (
int) – The upper boundray of the range of possible values.object (
GObject.Object) – The object this query box is associated with.signal (
str) – The object’s signal which will cause the query box to be closed.callback (
GimpUi.QueryIntCallback) – The function which will be called when the user selects “OK”.
- Returns:
A pointer to the new
Gtk.Dialog.- Return type:
Creates a new
Gtk.Dialogthat queries the user for an integer value.
- GimpUi.query_size_box(title, parent, help_func, help_id, message, initial, lower, upper, digits, unit, resolution, dot_for_dot, object, signal, callback, *data)¶
- Parameters:
title (
str) – The query box dialog’s title.parent (
Gtk.Widget) – The dialog’s parent widget.help_func (
GimpUi.HelpFunc) – The help function to show this dialog’s help page.help_id (
str) – A string identifying this dialog’s help page.message (
str) – A string which will be shown above the dialog’s entry widget.initial (
float) – The initial value.lower (
float) – The lower boundary of the range of possible values.upper (
float) – The upper boundray of the range of possible values.digits (
int) – The number of decimal digits theGimpUi.SizeEntryprovide in “pixel” mode.unit (
Gimp.Unit) – The unit initially shown by the #GimpUnitMenu.resolution (
float) – The resolution (in dpi) which will be used for pixel/unit calculations.dot_for_dot (
bool) –Trueif the #GimpUnitMenu’s initial unit should be “pixels”.object (
GObject.Object) – The object this query box is associated with.signal (
str) – The object’s signal which will cause the query box to be closed.callback (
GimpUi.QuerySizeCallback) – The function which will be called when the user selects “OK”.
- Returns:
A pointer to the new
Gtk.Dialog.- Return type:
Creates a new
Gtk.Dialogthat queries the user for a size using aGimpUi.SizeEntry.
- GimpUi.query_string_box(title, parent, help_func, help_id, message, initial, object, signal, callback, *data)¶
- Parameters:
title (
str) – The query box dialog’s title.parent (
Gtk.Widget) – The dialog’s parent widget.help_func (
GimpUi.HelpFunc) – The help function to show this dialog’s help page.help_id (
str) – A string identifying this dialog’s help page.message (
str) – A string which will be shown above the dialog’s entry widget.initial (
str) – The initial value.object (
GObject.Object) – The object this query box is associated with.signal (
str) – The object’s signal which will cause the query box to be closed.callback (
GimpUi.QueryStringCallback) – The function which will be called when the user selects “OK”.
- Returns:
A pointer to the new
Gtk.Dialog.- Return type:
Creates a new
Gtk.Dialogthat queries the user for a string value.
- GimpUi.radio_button_update(widget)¶
- Parameters:
widget (
Gtk.Widget) – AGtk.RadioButton.- Returns:
A return location for the value of
GPOINTER_TO_INT (g_object_get_data (@widget, "gimp-item-data")).- Return type:
data:
int
- GimpUi.random_seed_new(seed, random_seed)¶
- Parameters:
- Returns:
A
Gtk.Boxcontaining aGtk.SpinButtonfor the seed and aGtk.Buttonfor setting a random seed.- Return type:
Creates a widget that allows the user to control how the random number generator is initialized.
- GimpUi.scroll_adjustment_values(sevent, hadj, vadj)¶
- Parameters:
sevent (
Gdk.EventScroll) – AGdk.EventScrollhadj (
Gtk.AdjustmentorNone) – Horizontal adjustmentvadj (
Gtk.AdjustmentorNone) – Vertical adjustment
- Returns:
- Return type:
- GimpUi.standard_help_func(help_id, help_data)¶
- Parameters:
help_id (
str) – A unique help identifier.help_data (
objectorNone) – The help_data passed toGimpUi.help_connect().
This is the standard GIMP help function which does nothing but calling
Gimp.help(). It is the right function to use in almost all cases.
- GimpUi.toggle_button_update(widget)¶
- Parameters:
widget (
Gtk.Widget) – AGtk.ToggleButton.- Returns:
A return location for the value of
Gtk.ToggleButton.get_active().- Return type:
data:
bool
- GimpUi.uint_adjustment_update(adjustment)¶
- Parameters:
adjustment (
Gtk.Adjustment) – AGtk.Adjustment.- Returns:
A return location for the adjustment's value.
- Return type:
data:
int
Note that the
Gtk.Adjustment's value (which is afloat) will be rounded with (int) (value + 0.5).
- GimpUi.widget_animation_enabled()¶
-
This function attempts to read the user’s system preference for showing animation. It can be used to turn off or hide unnecessary animations such as the scrolling credits or Easter Egg animations.
New in version 3.0.
- GimpUi.widget_free_native_handle(widget, window_handle)¶
- Parameters:
widget (
Gtk.Widget) – a widget we got a handle for.window_handle (
GLib.Bytes) – same pointer previously passed to [func`GimpUi`.widget_set_native_handle].
- Returns:
same pointer previously passed to [func`GimpUi`.widget_set_native_handle].
- Return type:
window_handle:
GLib.Bytes
Disposes a widget’s native window handle created, possibly asynchronously, by a previous call to [func`GimpUi`.widget_set_native_handle].
Depending on the platform, this function may also execute other necessary clean up so you should call it and not simply free the [struct`GLib`.Bytes] yourself.
You should call this function in the
dispose()implementation of your custom widget **before** chaining up with the parent class’dispose()call. The first call to the parent’sdispose()will destroy theGdkWindowwhich will prevent this function to do part of its cleanup when run after. This may result in crashes on some platforms.This is safe to call even if deferenced window_handle is
None, i.e. that you don’t have to check if the window handle was actually set.New in version 3.0.
- GimpUi.widget_get_color_profile(widget)¶
- Parameters:
widget (
Gtk.Widget) – aGtk.Widget- Returns:
widget's monitor’s
Gimp.ColorProfile, orNone.- Return type:
This function returns the
Gimp.ColorProfileof the monitor widget is currently displayed on, orNoneif there is no profile configured.New in version 3.0.
- GimpUi.widget_get_color_transform(widget, config, src_profile, src_format, dest_format, softproof_profile, proof_intent, proof_bpc)¶
- Parameters:
widget (
Gtk.Widget) – aGtk.Widgetconfig (
Gimp.ColorConfig) – aGimp.ColorConfigsrc_profile (
Gimp.ColorProfile) – aGimp.ColorProfilesrc_format (
Babl.Object) –Babl.Objectformat for the transform’s source pixelsdest_format (
Babl.Object) –Babl.Objectformat for the transforms’s destination pixelssoftproof_profile (
Gimp.ColorProfile) –proof_intent (
Gimp.ColorRenderingIntent) –proof_bpc (
bool) –
- Returns:
the
Gimp.ColorTransform.- Return type:
This function returns the
Gimp.ColorTransformthat transforms pixels from src_profile to the profile of theGdk.Monitorthe widget is displayed on.New in version 2.10.
- GimpUi.widget_get_monitor(widget)¶
- Parameters:
widget (
Gtk.Widget) – aGtk.Widget.- Returns:
the
Gdk.Monitorwhere widget is current displayed on.- Return type:
- GimpUi.widget_get_render_space(widget, config)¶
- Parameters:
widget (
Gtk.Widget) –config (
Gimp.ColorConfig) –
- Return type:
- GimpUi.widget_set_native_handle(widget, window_handle)¶
- Parameters:
widget (
Gtk.Widget) – a widget to get a handle for.window_handle (
GLib.Bytes) – pointer to store the native handle as a [struct`GLib`.Bytes].
- Returns:
pointer to store the native handle as a [struct`GLib`.Bytes].
- Return type:
window_handle:
GLib.Bytes
This function is to be used in custom widget construction to store the window handle representing widget into window_handle so that it can later be reused to set other windows as transient to this one (even across processes, such as in-between plug-ins), e.g. using [func`GimpUi`.window_set_transient_for].
Depending on the platform, the actual content of window_handle can be various types and should therefore be considered an opaque data. Moreover it may be filled asynchronously in a callback, so you should not assume that window_handle is set after running this function.
This convenience function is safe to use even before widget is visible as it will set the handle once it is mapped.
Free window_handle on
dispose()orfinalize()with [func`GimpUi`.widget_free_native_handle].New in version 3.0.
- GimpUi.widget_track_monitor(widget, monitor_changed_callback, *user_data)¶
- Parameters:
widget (
Gtk.Widget) – aGtk.Widgetmonitor_changed_callback (
GObject.Callback) – the callback when widget's monitor changesuser_data (
objectorNone) – data passed to monitor_changed_callback
This function behaves as if
Gtk.Widgethad a signalGtkWidget::monitor_changed(
Gtk.Widget*widget,objectuser_data)That is emitted whenever widget's toplevel window is moved from one monitor to another. This function automatically connects to the right toplevel
Gtk.Window, even across moving widget between toplevel windows.Note that this function tracks the toplevel, not widget itself, so all a window’s widgets are always considered to be on the same monitor. This is because this function is mainly used for fetching the new monitor’s color profile, and it makes little sense to use different profiles for the widgets of one window.
New in version 2.10.
- GimpUi.widgets_error_quark()¶
- Returns:
the #GQuark that defines the GIMP widgets error domain.
- Return type:
This function is never called directly. Use GIMP_WIDGETS_ERROR() instead.
- GimpUi.window_set_transient(window)¶
- Parameters:
window (
Gtk.Window) – theGtk.Windowthat should become transient
Indicates to the window manager that window is a transient dialog associated with the GIMP window that the plug-in has been started from. See also
GimpUi.window_set_transient_for_display().New in version 2.4.
- GimpUi.window_set_transient_for(window, handle)¶
- Parameters:
window (
Gtk.Window) – theGtk.Windowthat should become transienthandle (
GLib.Bytes) – handle of the window that should become the parent
Indicates to the window manager that window is a transient dialog to the window identified by handle.
Note that handle is an opaque data, which you should not try to construct yourself or make sense of. It may be different things depending on the OS or even the display server. You should only use a handle returned by [func`Gimp`.progress_get_window_handle], [method`Gimp`.:ref:xlib.Display.get_window_handle <xlib.Display.fields>] or [method`GimpUi`.Dialog.get_native_handle].
Most of the time you will want to use the convenience function [func`GimpUi`.window_set_transient].
New in version 3.0.
- GimpUi.window_set_transient_for_display(window, display)¶
- Parameters:
window (
Gtk.Window) – theGtk.Windowthat should become transientdisplay (
Gimp.Display) – display of the image window that should become the parent
Indicates to the window manager that window is a transient dialog associated with the GIMP image window that is identified by its display. See [method`Gdk`.Window.set_transient_for] for more information.
Most of the time you will want to use the convenience function [func`GimpUi`.window_set_transient].
New in version 2.4.
- GimpUi.zoom_button_new(model, zoom_type, icon_size)¶
- Parameters:
model (
GimpUi.ZoomModel) – aGimpUi.ZoomModelzoom_type (
GimpUi.ZoomType) –icon_size (
Gtk.IconSize) – use 0 for a button with text labels
- Returns:
a newly created
Gtk.ButtonSince GIMP 2.4
- Return type: