GimpUi.ItemChooser

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 Gtk.Orientable Gtk.Orientable GObject.GInterface->Gtk.Orientable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned GimpUi.ItemChooser GimpUi.ItemChooser Gtk.Box Gtk.Box Gtk.Box->GimpUi.ItemChooser Gtk.Buildable->Gtk.Widget Gtk.Container Gtk.Container Gtk.Container->Gtk.Box Gtk.Orientable->Gtk.Box Gtk.Widget->Gtk.Container

Subclasses:

None

Methods

Inherited:

Gtk.Box (14), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.Orientable (2)

Structs:

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

class

new (title, label, item_type, item)

get_item ()

get_label ()

set_item (item)

Virtual Methods

Inherited:

Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10)

Properties

Inherited:

Gtk.Box (3), Gtk.Container (3), Gtk.Widget (39), Gtk.Orientable (1)

Name

Type

Flags

Short Description

item

Gimp.Item

r/w/en

The currently selected item

item-type

GObject.GType

r/w/co

The GObject.GType of the item property

label

str

r/w/co

The label to be used next to the button

title

str

r/w/co

The title to be used for the item selection popup dialog

Child Properties

Inherited:

Gtk.Box (5)

Style Properties

Inherited:

Gtk.Widget (17)

Signals

Inherited:

Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Fields

Inherited:

Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Class Details

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

Gtk.Box

Abstract:

No

Structure:

GimpUi.ItemChooserClass

The chooser contains an optional label and a button which queries the core process to pop up a item selection dialog.

New in version 3.2.

classmethod new(title, label, item_type, item)
Parameters:
  • title (str or None) – Title of the dialog to use or None to use the default title.

  • label (str or None) – Button label or None for no label.

  • item_type (GObject.GType) – the acceptable subtype of choosable items.

  • item (Gimp.Item or None) – Initial item.

Returns:

A [class`GimpUi`.ItemChooser.

Return type:

Gtk.Widget

Creates a new Gtk.Widget that lets a user choose a item which must be of type item_type. item_type of values GObject.TYPE_NONE and %GIMP_TYPE_ITEM are equivalent. Otherwise it must be a subtype of %GIMP_TYPE_ITEM.

When item is None, initial choice is from context.

New in version 3.2.

get_item()
Returns:

an internal copy of the item which must not be freed.

Return type:

Gimp.Item

Gets the currently selected item.

New in version 3.2.

get_label()
Returns:

the [class`Gtk`.Widget] showing the label text.

Return type:

Gtk.Widget

Returns the label widget.

New in version 3.2.

set_item(item)
Parameters:

item (Gimp.Item) – Item to set.

Sets the currently selected item. This will select the item in both the button and any chooser popup.

New in version 3.2.

Property Details

GimpUi.ItemChooser.props.item
Name:

item

Type:

Gimp.Item

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The currently selected item.

New in version 3.0.

GimpUi.ItemChooser.props.item_type
Name:

item-type

Type:

GObject.GType

Default Value:

<GType GimpItem>

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Allowed item types, which must be either GIMP_TYPE_ITEM or a subtype.

New in version 3.0.

GimpUi.ItemChooser.props.label
Name:

label

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Label text with mnemonic.

New in version 3.0.

GimpUi.ItemChooser.props.title
Name:

title

Type:

str

Default Value:

'Item Selection'

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The title to be used for the item selection popup dialog.

New in version 3.0.