GimpUi.ChainButton

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.ChainButton GimpUi.ChainButton Gtk.Buildable->Gtk.Widget Gtk.Container Gtk.Container Gtk.Grid Gtk.Grid Gtk.Container->Gtk.Grid Gtk.Grid->GimpUi.ChainButton Gtk.Orientable->Gtk.Grid Gtk.Widget->Gtk.Container

Subclasses:

None

Methods

Inherited:

Gtk.Grid (21), 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 (position)

get_active ()

get_button ()

get_icon_size ()

set_active (active)

set_icon_size (size)

Virtual Methods

Inherited:

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

Properties

Inherited:

Gtk.Grid (5), Gtk.Container (3), Gtk.Widget (39), Gtk.Orientable (1)

Name

Type

Flags

Short Description

active

bool

r/w/c

The chain’s toggled state

icon-size

Gtk.IconSize

r/w/c

The chain’s icon size

position

GimpUi.ChainPosition

r/w/co

The chain’s position

Child Properties

Inherited:

Gtk.Grid (4)

Style Properties

Inherited:

Gtk.Widget (17)

Signals

Inherited:

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

Name

Short Description

toggled

Fields

Inherited:

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

Class Details

class GimpUi.ChainButton(**kwargs)
Bases:

Gtk.Grid

Abstract:

No

Structure:

GimpUi.ChainButtonClass

This widget provides a button showing either a linked or a broken chain that can be used to link two entries, spinbuttons, colors or other GUI elements and show that they may be locked. Use it for example to connect X and Y ratios to provide the possibility of a constrained aspect ratio.

The GimpUi.ChainButton only gives visual feedback, it does not really connect widgets. You have to take care of locking the values yourself by checking the state of the GimpUi.ChainButton whenever a value changes in one of the connected widgets and adjusting the other value if necessary.

classmethod new(position)
Parameters:

position (GimpUi.ChainPosition) – The position you are going to use for the button with respect to the widgets you want to chain.

Returns:

Pointer to the new GimpUi.ChainButton, which is inactive by default. Use GimpUi.ChainButton.set_active() to change its state.

Return type:

Gtk.Widget

Creates a new GimpUi.ChainButton widget.

This returns a button showing either a broken or a linked chain and small clamps attached to both sides that visually group the two widgets you want to connect. This widget looks best when attached to a grid taking up two columns (or rows respectively) next to the widgets that it is supposed to connect. It may work for more than two widgets, but the look is optimized for two.

get_active()
Returns:

True if the GimpUi.ChainButton is active (locked).

Return type:

bool

Checks the state of the GimpUi.ChainButton.

get_button()
Returns:

The GimpUi.ChainButton's button.

Return type:

Gtk.Button

New in version 3.0.

get_icon_size()
Returns:

The icon size.

Return type:

Gtk.IconSize

Gets the icon size of the GimpUi.ChainButton.

New in version 2.10.10.

set_active(active)
Parameters:

active (bool) – The new state.

Sets the state of the GimpUi.ChainButton to be either locked (True) or unlocked (False) and changes the showed pixmap to reflect the new state.

set_icon_size(size)
Parameters:

size (Gtk.IconSize) – The new icon size.

Sets the icon size of the GimpUi.ChainButton.

New in version 2.10.10.

Signal Details

GimpUi.ChainButton.signals.toggled(chain_button)
Signal Name:

toggled

Flags:

RUN_FIRST

Parameters:

chain_button (GimpUi.ChainButton) – The object which received the signal

Property Details

GimpUi.ChainButton.props.active
Name:

active

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT

The toggled state of the chain button.

New in version 2.10.10.

GimpUi.ChainButton.props.icon_size
Name:

icon-size

Type:

Gtk.IconSize

Default Value:

Gtk.IconSize.BUTTON

Flags:

READABLE, WRITABLE, CONSTRUCT

The chain button icon size.

New in version 2.10.10.

GimpUi.ChainButton.props.position
Name:

position

Type:

GimpUi.ChainPosition

Default Value:

GimpUi.ChainPosition.TOP

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The position in which the chain button will be used.

New in version 2.4.