Amtk.Factory¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
|||
r/w |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class Amtk.Factory(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new(application)¶
- Parameters:
application (
Gtk.Application
orNone
) – aGtk.Application
, orNone
.- Returns:
a new
Amtk.Factory
.- Return type:
Creates a new
Amtk.Factory
object. Associating aGtk.Application
is optional, if it isNone
Gtk.Application.set_accels_for_action
() won’t be called.New in version 3.0.
- classmethod new_with_default_application()¶
- Returns:
a new
Amtk.Factory
with the defaultGtk.Application
.- Return type:
Calls
Amtk.Factory.new
() withGio.Application.get_default
() (it must be aGtk.Application
).New in version 3.0.
- Parameters:
action_name (
str
) – an action name.- Returns:
a new
Gtk.CheckMenuItem
for action_name.- Return type:
Creates a new
Gtk.CheckMenuItem
for action_name with theAmtk.Factory
:default-flags
.See the documentation of
Amtk.Factory.create_check_menu_item_full
() for more information.New in version 3.0.
- Parameters:
action_name (
str
) – an action name.flags (
Amtk.FactoryFlags
) –Amtk.FactoryFlags
.
- Returns:
a new
Gtk.CheckMenuItem
for action_name.- Return type:
This function ignores the
Amtk.Factory
:default-flags
property and takes the flags argument instead.Note that since it is a
Gtk.CheckMenuItem
the icon is not set, even if it would be possible withAmtk.menu_item_set_icon_name
().If the action controls a boolean property, think about using
Gio.PropertyAction
.New in version 3.0.
- Parameters:
action_name (
str
) – an action name.- Returns:
a new
Gio.MenuItem
for action_name.- Return type:
Calls
Amtk.Factory.create_gmenu_item_full
() with theAmtk.Factory
:default-flags
.New in version 5.0.
- Parameters:
action_name (
str
) – an action name.flags (
Amtk.FactoryFlags
) –Amtk.FactoryFlags
.
- Returns:
a new
Gio.MenuItem
for action_name.- Return type:
This function ignores the
Amtk.Factory
:default-flags
property and takes the flags argument instead.Creates a new
Gio.MenuItem
for action_name. It ignores the tooltip, i.e. the return value ofAmtk.ActionInfo.get_tooltip
().New in version 5.0.
- Parameters:
action_name (
str
) – an action name.- Returns:
a new
Gtk.MenuItem
for action_name.- Return type:
Creates a new
Gtk.MenuItem
for action_name with theAmtk.Factory
:default-flags
.New in version 3.0.
- Parameters:
action_name (
str
) – an action name.flags (
Amtk.FactoryFlags
) –Amtk.FactoryFlags
.
- Returns:
a new
Gtk.MenuItem
for action_name.- Return type:
This function ignores the
Amtk.Factory
:default-flags
property and takes the flags argument instead.New in version 3.0.
- Parameters:
action_name (
str
) – an action name.- Returns:
a new
Gtk.MenuToolButton
for action_name.- Return type:
Creates a new
Gtk.MenuToolButton
for action_name with theAmtk.Factory
:default-flags
.See the documentation of
Amtk.Factory.create_menu_tool_button_full
() for more information.New in version 3.0.
- Parameters:
action_name (
str
) – an action name.flags (
Amtk.FactoryFlags
) –Amtk.FactoryFlags
.
- Returns:
a new
Gtk.MenuToolButton
for action_name.- Return type:
This function ignores the
Amtk.Factory
:default-flags
property and takes the flags argument instead.After calling this function, you need to use the
Gtk.MenuToolButton
API to set the menu and also possibly set a tooltip to the arrow.New in version 3.0.
- create_shortcut(action_name)¶
- Parameters:
action_name (
str
) – an action name.- Returns:
a new
Gtk.ShortcutsShortcut
for action_name.- Return type:
Calls
Amtk.Factory.create_shortcut_full
() with theAmtk.Factory
:default-flags
.New in version 5.0.
- create_shortcut_full(action_name, flags)¶
- Parameters:
action_name (
str
) – an action name.flags (
Amtk.FactoryFlags
) –Amtk.FactoryFlags
.
- Returns:
a new
Gtk.ShortcutsShortcut
for action_name.- Return type:
This function ignores the
Amtk.Factory
:default-flags
property and takes the flags argument instead.This function creates a new
Gtk.ShortcutsShortcut
for action_name.For the
Gtk.ShortcutsShortcut
:title
, the tooltip has the priorioty, with the label as fallback if the tooltip isNone
(the mnemonic is removed from the label withAmtk.utils_remove_mnemonic
()). This can be controlled with theAmtk.FactoryFlags.IGNORE_TOOLTIP
andAmtk.FactoryFlags.IGNORE_LABEL
flags.The
Gtk.ShortcutsShortcut
:accelerator
property is set with only the *first* accel returned byAmtk.ActionInfo.get_accels
(). This step can be ignored withAmtk.FactoryFlags.IGNORE_ACCELS
orAmtk.FactoryFlags.IGNORE_ACCELS_FOR_DOC
.The
Gtk.ShortcutsShortcut
:action-name
property is set to action_name if theAmtk.FactoryFlags.IGNORE_GACTION
flag isn’t set. Note that withGtk.ShortcutsShortcut
:action-name
all accelerators are displayed (if set to theGtk.Application
).So depending on whether you want to show only the first accelerator or all accelerators, you need to set flags appropriately.
New in version 5.0.
- Parameters:
entries ([
Amtk.ActionInfoEntry
]) – a pointer to the first item in an array ofAmtk.ActionInfoEntry
structs.- Returns:
a new simple
Gtk.Menu
for entries.- Return type:
Calls
Amtk.Factory.create_simple_menu_full
() with theAmtk.Factory
:default-flags
.New in version 5.0.
- Parameters:
entries ([
Amtk.ActionInfoEntry
]) – a pointer to the first item in an array ofAmtk.ActionInfoEntry
structs.flags (
Amtk.FactoryFlags
) –Amtk.FactoryFlags
.
- Returns:
a new simple
Gtk.Menu
for entries.- Return type:
This function ignores the
Amtk.Factory
:default-flags
property and takes the flags argument instead.This function:
Creates a
Gtk.Menu
;For each
Amtk.ActionInfoEntry
action name from entries, creates aGtk.MenuItem
withAmtk.Factory.create_menu_item_full
() with the same flags as passed in to this function, and appends it to theGtk.Menu
, in the same order as provided by the entries array.
So this function is useful only if the
Gtk.Menu
contains only simpleGtk.MenuItem
's, notGtk.CheckMenuItem
's norGtk.RadioMenuItem
's.New in version 5.0.
- create_tool_button(action_name)¶
- Parameters:
action_name (
str
) – an action name.- Returns:
a new
Gtk.ToolButton
for action_name.- Return type:
Creates a new
Gtk.ToolButton
for action_name with theAmtk.Factory
:default-flags
.New in version 3.0.
- create_tool_button_full(action_name, flags)¶
- Parameters:
action_name (
str
) – an action name.flags (
Amtk.FactoryFlags
) –Amtk.FactoryFlags
.
- Returns:
a new
Gtk.ToolButton
for action_name.- Return type:
This function ignores the
Amtk.Factory
:default-flags
property and takes the flags argument instead.New in version 3.0.
- get_application()¶
- Returns:
the
Amtk.Factory
:application
.- Return type:
New in version 3.0.
- get_default_flags()¶
- Returns:
- Return type:
New in version 3.0.
- set_default_flags(default_flags)¶
- Parameters:
default_flags (
Amtk.FactoryFlags
) – the new value.
Sets the
Amtk.Factory
:default-flags
property.New in version 3.0.
Property Details¶
- Amtk.Factory.props.application¶
- Name:
application
- Type:
- Default Value:
- Flags:
The associated
Gtk.Application
(it is optional, it can beNone
).Amtk.Factory
has a weak reference to theGtk.Application
.New in version 3.0.
- Amtk.Factory.props.default_flags¶
- Name:
default-flags
- Type:
- Default Value:
- Flags:
The default
Amtk.FactoryFlags
.New in version 3.0.