Gimp.Choice

g GObject.Object GObject.Object Gimp.Choice Gimp.Choice GObject.Object->Gimp.Choice

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

add (nick, id, label, help)

get_documentation (nick, label, help)

get_help (nick)

get_id (nick)

get_label (nick)

is_valid (nick)

list_nicks ()

set_sensitive (nick, sensitive)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Name

Short Description

sensitivity-changed

Fields

Inherited:

GObject.Object (1)

Class Details

class Gimp.Choice(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Gimp.ChoiceClass

classmethod new()
Returns:

a Gimp.Choice.

Return type:

Gimp.Choice

New in version 3.0.

add(nick, id, label, help)
Parameters:
  • nick (str) – the nick of self.

  • id (int) – optional integer ID for nick.

  • label (str) – the label of self.

  • help (str) – optional longer help text for nick.

This procedure adds a new possible value to self list of values. The id is an optional integer identifier. This can be useful for instance when you want to work with different enum values mapped to each nick.

New in version 3.0.

get_documentation(nick, label, help)
Parameters:
  • nick (str) – the possible value’s nick you need documentation for.

  • label (str) – the label of nick.

  • help (str) – the help text of nick.

Returns:

True if nick is found, False otherwise.

Return type:

bool

Returns the documentation strings for nick.

New in version 3.0.

get_help(nick)
Parameters:

nick (str) – the nick to lookup.

Returns:

the help text of nick.

Return type:

str

Returns the longer documentation for nick.

New in version 3.0.

get_id(nick)
Parameters:

nick (str) – the nick to lookup.

Returns:

the ID of nick.

Return type:

int

New in version 3.0.

get_label(nick)
Parameters:

nick (str) – the nick to lookup.

Returns:

the label of nick.

Return type:

str

New in version 3.0.

is_valid(nick)
Parameters:

nick (str) – the nick to check.

Returns:

Whether the choice is valid.

Return type:

bool

This procedure checks if the given nick is valid and refers to an existing choice.

New in version 3.0.

list_nicks()
Returns:

The list of self's nicks.

Return type:

[str]

This procedure returns the list of nicks allowed for self.

New in version 3.0.

set_sensitive(nick, sensitive)
Parameters:
  • nick (str) – the nick to lookup.

  • sensitive (bool) –

Change the sensitivity of a possible nick. Technically a non-sensitive nick means it cannot be chosen anymore (so [method`Gimp`.Choice.is_valid] will return False; nevertheless [method`Gimp`.Choice.list_nicks] and other functions to get information about a choice will still function).

New in version 3.0.

Signal Details

Gimp.Choice.signals.sensitivity_changed(choice, object)
Signal Name:

sensitivity-changed

Flags:

RUN_FIRST

Parameters:
  • choice (Gimp.Choice) – The object which received the signal

  • object (str) –