GimpUi.ColorButton

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Actionable Gtk.Actionable GObject.GInterface->Gtk.Actionable Gtk.Activatable Gtk.Activatable GObject.GInterface->Gtk.Activatable Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned GimpUi.Button GimpUi.Button GimpUi.ColorButton GimpUi.ColorButton GimpUi.Button->GimpUi.ColorButton Gtk.Button Gtk.Button Gtk.Actionable->Gtk.Button Gtk.Activatable->Gtk.Button Gtk.Bin Gtk.Bin Gtk.Bin->Gtk.Button Gtk.Buildable->Gtk.Widget Gtk.Button->GimpUi.Button Gtk.Container Gtk.Container Gtk.Container->Gtk.Bin Gtk.Widget->Gtk.Container

Subclasses:

None

Methods

Inherited:

GimpUi.Button (2), Gtk.Button (29), Gtk.Bin (1), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.Actionable (5), Gtk.Activatable (6)

Structs:

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

class

new (title, width, height, color, type)

get_action_group ()

get_color ()

get_title ()

get_update ()

has_alpha ()

set_color (color)

set_color_config (config)

set_title (title)

set_type (type)

set_update (continuous)

Virtual Methods

Inherited:

GimpUi.Button (1), Gtk.Button (6), Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10), Gtk.Actionable (4), Gtk.Activatable (2)

do_color_changed ()

do_get_action_type ()

Properties

Inherited:

Gtk.Button (9), Gtk.Container (3), Gtk.Widget (39), Gtk.Actionable (2), Gtk.Activatable (2)

Name

Type

Flags

Short Description

area-height

int

w/c

The minimum height of the button’s GimpUi.ColorArea

area-width

int

w/c

The minimum width of the button’s GimpUi.ColorArea

color

Gegl.Color

r/w/c

The color displayed in the button’s color area

color-config

Gimp.ColorConfig

r/w

The color config object used

continuous-update

bool

r/w/c

The update policy of the color button

title

str

r/w/c

The title to be used for the color selection dialog

type

GimpUi.ColorAreaType

r/w/c

The type of the button’s color area

Style Properties

Inherited:

Gtk.Button (7), Gtk.Widget (17)

Signals

Inherited:

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

Name

Short Description

color-changed

Fields

Inherited:

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

Name

Type

Access

Description

parent_instance

GimpUi.Button

r

Class Details

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

GimpUi.Button

Abstract:

No

Structure:

GimpUi.ColorButtonClass

This widget provides a simple button with a preview showing the color.

On click a color selection dialog is opened. Additionally the button supports Drag and Drop and has a right-click menu that allows one to choose the color from the current FG or BG color. If the user changes the color, the “color-changed” signal is emitted.

classmethod new(title, width, height, color, type)
Parameters:
  • title (str) – String that will be used as title for the color_selector.

  • width (int) – Width of the colorpreview in pixels.

  • height (int) – Height of the colorpreview in pixels.

  • color (Gegl.Color) – A [class`Gegl`.Color].

  • type (GimpUi.ColorAreaType) – The type of transparency to be displayed.

Returns:

Pointer to the new GimpUi.ColorButton widget.

Return type:

Gtk.Widget

Creates a new GimpUi.ColorButton widget.

This returns a button with a preview showing the color. When the button is clicked a Gtk.ColorSelectionDialog is opened. If the user changes the color the new color is written into the array that was used to pass the initial color and the “color-changed” signal is emitted.

get_action_group()
Returns:

The self's Gio.SimpleActionGroup.

Return type:

Gio.SimpleActionGroup

New in version 3.0.

get_color()
Returns:

a copy of self's [class`Gegl`.Color].

Return type:

Gegl.Color

Retrieves the currently set color from the self.

get_title()
Returns:

The self dialog’s title.

Return type:

str

New in version 2.10.

get_update()
Returns:

the continuous_update property.

Return type:

bool

Returns the color button’s continuous_update property.

has_alpha()
Returns:

True if the self shows transparency information, False otherwise.

Return type:

bool

Checks whether the buttons shows transparency information.

set_color(color)
Parameters:

color (Gegl.Color) – A new [class`Gegl`.Color].

Sets the self to the given color.

set_color_config(config)
Parameters:

config (Gimp.ColorConfig) – a Gimp.ColorConfig object.

Sets the color management configuration to use with this color button’s GimpUi.ColorArea.

New in version 2.10.

set_title(title)
Parameters:

title (str) – the new title.

Sets the self dialog’s title.

New in version 2.10.

set_type(type)
Parameters:

type (GimpUi.ColorAreaType) – the new GimpUi.ColorAreaType

Sets the self to the given type. See also GimpUi.ColorArea.set_type().

set_update(continuous)
Parameters:

continuous (bool) – The new setting of the continuous_update property.

When set to True, the self will emit the “color-changed” continuously while the color is changed in the color selection dialog.

do_color_changed() virtual
do_get_action_type() virtual
Return type:

GObject.GType

Signal Details

GimpUi.ColorButton.signals.color_changed(color_button)
Signal Name:

color-changed

Flags:

RUN_FIRST

Parameters:

color_button (GimpUi.ColorButton) – The object which received the signal

Property Details

GimpUi.ColorButton.props.area_height
Name:

area-height

Type:

int

Default Value:

16

Flags:

WRITABLE, CONSTRUCT

The minimum height of the button’s GimpUi.ColorArea.

New in version 2.8.

GimpUi.ColorButton.props.area_width
Name:

area-width

Type:

int

Default Value:

16

Flags:

WRITABLE, CONSTRUCT

The minimum width of the button’s GimpUi.ColorArea.

New in version 2.8.

GimpUi.ColorButton.props.color
Name:

color

Type:

Gegl.Color

Default Value:

<Color object at 0x000000000000 (GeglColor at 0x0000000)>

Flags:

READABLE, WRITABLE, CONSTRUCT

The color displayed in the button’s color area.

New in version 2.4.

GimpUi.ColorButton.props.color_config
Name:

color-config

Type:

Gimp.ColorConfig

Default Value:

None

Flags:

READABLE, WRITABLE

The Gimp.ColorConfig object used for the button’s GimpUi.ColorArea and GimpUi.ColorSelection.

New in version 2.10.

GimpUi.ColorButton.props.continuous_update
Name:

continuous-update

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT

The update policy of the color button.

New in version 2.4.

GimpUi.ColorButton.props.title
Name:

title

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT

The title to be used for the color selection dialog.

New in version 2.4.

GimpUi.ColorButton.props.type
Name:

type

Type:

GimpUi.ColorAreaType

Default Value:

GimpUi.ColorAreaType.FLAT

Flags:

READABLE, WRITABLE, CONSTRUCT

The type of the button’s color area.

New in version 2.4.