Amtk.ActionInfo

Fields

None

Methods

class

new ()

class

new_from_entry (info_entry, translation_domain)

copy ()

get_accels ()

get_action_name ()

get_icon_name ()

get_label ()

get_tooltip ()

has_been_used ()

mark_as_used ()

ref ()

set_accels (accels)

set_action_name (action_name)

set_icon_name (icon_name)

set_label (label)

set_tooltip (tooltip)

unref ()

Details

class Amtk.ActionInfo
classmethod new()
Returns:

a new Amtk.ActionInfo.

Return type:

Amtk.ActionInfo

New in version 2.0.

classmethod new_from_entry(info_entry, translation_domain)
Parameters:
Returns:

a new Amtk.ActionInfo.

Return type:

Amtk.ActionInfo

Creates a new Amtk.ActionInfo from an Amtk.ActionInfoEntry.

If translation_domain is not None, GLib.dgettext() is used to translate the label and tooltip before setting them to the Amtk.ActionInfo.

New in version 2.0.

copy()
Returns:

a copy of self. The copy will have a reference count of one.

Return type:

Amtk.ActionInfo

New in version 2.0.

get_accels()
Returns:

a None-terminated array of accelerators in the format understood by Gtk.accelerator_parse().

Return type:

[str]

Returns the accelerators. This function never returns None, it always returns a None-terminated array, to be suitable for Gtk.Application.set_accels_for_action().

New in version 2.0.

get_action_name()
Returns:

the action name, or None. Example: "win.save". Can be a detailed action name, see Gio.Action.parse_detailed_name().

Return type:

str or None

New in version 2.0.

get_icon_name()
Returns:

the icon name, or None.

Return type:

str or None

New in version 2.0.

get_label()
Returns:

the label (i.e. a short description), or None.

Return type:

str or None

Gets the label. The label has normally a mnemonic. To remove the mnemonic, there is the Amtk.utils_remove_mnemonic() function.

New in version 2.0.

get_tooltip()
Returns:

the tooltip (i.e. a long description), or None.

Return type:

str or None

New in version 2.0.

has_been_used()
Returns:

whether self has been used.

Return type:

bool

Returns whether self has been used (for example by an Amtk.Factory function). See also Amtk.ActionInfoStore.check_all_used().

New in version 3.0.

mark_as_used()

Mark self as used. An Amtk.Factory function that uses an Amtk.ActionInfo should call this function. See Amtk.ActionInfoStore.check_all_used().

New in version 3.0.

ref()
Returns:

the passed in self.

Return type:

Amtk.ActionInfo

Increments the reference count of self by one.

New in version 2.0.

set_accels(accels)
Parameters:

accels ([str]) – a None-terminated array of accelerators in the format understood by Gtk.accelerator_parse().

A function similar to Gtk.Application.set_accels_for_action().

accels must not be None, it must be a None-terminated array, to be consistent with Gtk.Application.set_accels_for_action().

New in version 2.0.

set_action_name(action_name)
Parameters:

action_name (str) – the action name.

Sets the action name, for example "win.save". Can be a detailed action name, see Gio.Action.parse_detailed_name().

New in version 2.0.

set_icon_name(icon_name)
Parameters:

icon_name (str or None) – the icon name, or None.

New in version 2.0.

set_label(label)
Parameters:

label (str or None) – the label (i.e. a short description), or None.

Sets the label with a mnemonic. To know how to encode the mnemonic, see the documentation of Gtk.Label.new_with_mnemonic().

New in version 2.0.

set_tooltip(tooltip)
Parameters:

tooltip (str or None) – the tooltip (i.e. a long description), or None.

New in version 2.0.

unref()

Decrements the reference count of self by one. If the reference count drops to 0, self is freed.

New in version 2.0.