GimpUi.ResourceChooser

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.ResourceChooser GimpUi.ResourceChooser Gtk.Box Gtk.Box Gtk.Box->GimpUi.ResourceChooser Gtk.Buildable->Gtk.Widget Gtk.Container Gtk.Container Gtk.Container->Gtk.Box Gtk.Orientable->Gtk.Box Gtk.Widget->Gtk.Container

Subclasses:

GimpUi.BrushChooser, GimpUi.FontChooser, GimpUi.GradientChooser, GimpUi.PaletteChooser, GimpUi.PatternChooser

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)

get_label ()

get_resource ()

set_resource (resource)

Virtual Methods

Inherited:

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

do_draw_interior ()

do_resource_set (resource, dialog_closing)

Properties

Inherited:

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

Name

Type

Flags

Short Description

label

str

r/w/co

The label to be used next to the button

resource

Gimp.Resource

r/w

The currently selected resource

title

str

r/w/co

The title to be used for the resource 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)

Name

Short Description

resource-set

The ::resource-set signal is emitted when the user selects a resource.

Fields

Inherited:

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

Name

Type

Access

Description

parent_instance

Gtk.Box

r

Class Details

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

Gtk.Box

Abstract:

Yes

Structure:

GimpUi.ResourceChooserClass

A button which pops up a resource selection dialog.

Responsibilities:

  • implementing outer container widget,

    • managing clicks and popping up a remote chooser,

    • having a resource property,

    • signaling when user selects resource

    • receiving drag,

    • triggering draws of the button interior (by subclass) and draws of remote popup chooser.

Collaborations:

  • owned by GimpUi.ProcedureDialog via GimpPropWidget

    • resource property usually bound to a Gimp.Config for a GimpPluginProcedure.

    • communicates using GimpResourceSelect with remote GimpPDBDialog, to choose an installed Gimp.Resource owned by core.

Subclass responsibilities:

  • creating interior widgets

    • drawing the interior (a preview of the chosen resource)

    • declaring which interior widgets are drag destinations

    • declaring which interior widgets are clickable (generate “clicked” signal)

    • generate “clicked” (delegating to Gtk.Button or implementing from mouse events)

New in version 3.0.

get_label()
Returns:

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

Return type:

Gtk.Widget

Returns the label widget.

New in version 3.0.

get_resource()
Returns:

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

Return type:

Gimp.Resource

Gets the currently selected resource.

New in version 3.0.

set_resource(resource)
Parameters:

resource (Gimp.Resource) – Resource to set.

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

New in version 3.0.

do_draw_interior() virtual
do_resource_set(resource, dialog_closing) virtual
Parameters:

Signal Details

GimpUi.ResourceChooser.signals.resource_set(resource_chooser, resource, dialog_closing)
Signal Name:

resource-set

Flags:

RUN_FIRST

Parameters:
  • resource_chooser (GimpUi.ResourceChooser) – The object which received the signal

  • resource (GObject.Object) – the currently selected resource.

  • dialog_closing (bool) – whether the dialog was closed or not.

The ::resource-set signal is emitted when the user selects a resource.

New in version 3.0.

Property Details

GimpUi.ResourceChooser.props.label
Name:

label

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Label text with mnemonic.

New in version 3.0.

GimpUi.ResourceChooser.props.resource
Name:

resource

Type:

Gimp.Resource

Default Value:

None

Flags:

READABLE, WRITABLE

The currently selected resource.

New in version 3.0.

GimpUi.ResourceChooser.props.title
Name:

title

Type:

str

Default Value:

'Resource Selection'

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

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

New in version 3.0.