GimpUi.IntComboBox

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.CellEditable Gtk.CellEditable GObject.GInterface->Gtk.CellEditable Gtk.CellLayout Gtk.CellLayout GObject.GInterface->Gtk.CellLayout GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned GimpUi.IntComboBox GimpUi.IntComboBox Gtk.Bin Gtk.Bin Gtk.ComboBox Gtk.ComboBox Gtk.Bin->Gtk.ComboBox Gtk.Buildable->Gtk.Widget Gtk.CellEditable->Gtk.ComboBox Gtk.CellLayout->Gtk.ComboBox Gtk.ComboBox->GimpUi.IntComboBox Gtk.Container Gtk.Container Gtk.Container->Gtk.Bin Gtk.Widget->Gtk.Container

Subclasses:

GimpUi.ChannelComboBox, GimpUi.DrawableComboBox, GimpUi.EnumComboBox, GimpUi.ImageComboBox, GimpUi.LayerComboBox, GimpUi.PathComboBox

Methods

Inherited:

Gtk.ComboBox (40), Gtk.Bin (1), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.CellEditable (3), Gtk.CellLayout (9)

Structs:

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

class

new (labels)

connect (value, callback, *data)

get_active ()

get_active_user_data ()

get_label ()

get_layout ()

set_active (value)

set_active_by_user_data (user_data)

set_label (label)

set_layout (layout)

set_sensitivity (func, *data)

Virtual Methods

Inherited:

Gtk.ComboBox (2), Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10), Gtk.CellEditable (3), Gtk.CellLayout (9)

Properties

Inherited:

Gtk.ComboBox (16), Gtk.Container (3), Gtk.Widget (39), Gtk.CellEditable (1)

Name

Type

Flags

Short Description

ellipsize

Pango.EllipsizeMode

r/w

Ellipsize mode for the used text cell renderer

label

str

r/w

An optional label to be displayed

layout

GimpUi.IntComboBoxLayout

r/w

Combo box layout

value

int

r/w

Value of active item

Style Properties

Inherited:

Gtk.ComboBox (4), Gtk.Widget (17)

Signals

Inherited:

Gtk.ComboBox (5), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1), Gtk.CellEditable (2)

Fields

Inherited:

Gtk.ComboBox (5), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1), Gtk.CellEditable (2)

Name

Type

Access

Description

parent_instance

Gtk.ComboBox

r

Class Details

class GimpUi.IntComboBox(**kwargs)
Bases:

Gtk.ComboBox

Abstract:

No

Structure:

GimpUi.IntComboBoxClass

A widget providing a popup menu of integer values (e.g. enums).

classmethod new(labels)
Parameters:

labels ([str]) – an array of labels

Returns:

a new GimpUi.IntComboBox.

Return type:

Gtk.Widget

A variant of GimpUi.IntComboBox.new() that takes an array of labels. The array indices are used as values.

New in version 2.2.

connect(value, callback, *data)
Parameters:
  • value (int) – the value to set

  • callback (GObject.Callback) – a callback to connect to the self's “changed” signal

  • data (object or None) – a pointer passed as data to g_signal_connect()

Returns:

the signal handler ID as returned by g_signal_connect()

Return type:

int

A convenience function that sets the initial value of a GimpUi.IntComboBox and connects callback to the “changed” signal.

This function also calls the callback once after setting the initial value. This is often convenient when working with combo boxes that select a default active item, like for example GimpUi.DrawableComboBox.new(). If you pass an invalid initial value, the callback will be called with the default item active.

New in version 2.2.

get_active()
Returns:

True if value has been set or False if no item was active.

value:

return location for the integer value

Return type:

(bool, value: int)

Retrieves the value of the selected (active) item in the self.

New in version 2.2.

get_active_user_data()
Returns:

True if user_data has been set or False if no item was active.

user_data:

return location for the object value

Return type:

(bool, user_data: object)

Retrieves the user-data of the selected (active) item in the self.

New in version 2.10.

get_label()
Returns:

the self' label.

Return type:

str

Returns the label previously set with GimpUi.IntComboBox.set_label(), or None,

New in version 2.10.

get_layout()
Returns:

the self's layout.

Return type:

GimpUi.IntComboBoxLayout

Returns the layout of self

New in version 2.10.

set_active(value)
Parameters:

value (int) – an integer value

Returns:

True on success (value changed or not) or False if there was no item for this value.

Return type:

bool

Looks up the item that belongs to the given value and makes it the selected item in the self.

New in version 2.2.

set_active_by_user_data(user_data)
Parameters:

user_data (object or None) – an integer value

Returns:

True on success or False if there was no item for this user-data.

Return type:

bool

Looks up the item that has the given user_data and makes it the selected item in the self.

New in version 2.10.

set_label(label)
Parameters:

label (str) – a string to be shown as label

Sets a caption on the self that will be displayed left-aligned inside the box. When a label is set, the remaining contents of the box will be right-aligned. This is useful for places where screen estate is rare, like in tool options.

New in version 2.10.

set_layout(layout)
Parameters:

layout (GimpUi.IntComboBoxLayout) – the combo box layout

Sets the layout of self to layout.

New in version 2.10.

set_sensitivity(func, *data)
Parameters:

Sets a function that is used to decide about the sensitivity of rows in the self. Use this if you want to set certain rows insensitive.

Calling Gtk.Widget.queue_draw() on the self will cause the sensitivity to be updated.

New in version 2.4.

Property Details

GimpUi.IntComboBox.props.ellipsize
Name:

ellipsize

Type:

Pango.EllipsizeMode

Default Value:

Pango.EllipsizeMode.NONE

Flags:

READABLE, WRITABLE

Specifies the preferred place to ellipsize text in the combo-box, if the cell renderer does not have enough room to display the entire string.

New in version 2.4.

GimpUi.IntComboBox.props.label
Name:

label

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Sets a label on the combo-box, see GimpUi.IntComboBox.set_label().

New in version 2.10.

GimpUi.IntComboBox.props.layout
Name:

layout

Type:

GimpUi.IntComboBoxLayout

Default Value:

GimpUi.IntComboBoxLayout.ABBREVIATED

Flags:

READABLE, WRITABLE

Specifies the combo box layout.

New in version 2.10.

GimpUi.IntComboBox.props.value
Name:

value

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

The active value (different from the “active” property of Gtk.ComboBox which is the active index).

New in version 3.0.