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.ApplicationorNone) – aGtk.Application, orNone.- Returns:
a new
Amtk.Factory.- Return type:
Creates a new
Amtk.Factoryobject. Associating aGtk.Applicationis optional, if it isNoneGtk.Application.set_accels_for_action() won’t be called.New in version 3.0.
- classmethod new_with_default_application()¶
- Returns:
a new
Amtk.Factorywith 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.CheckMenuItemfor action_name.- Return type:
Creates a new
Gtk.CheckMenuItemfor 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.CheckMenuItemfor action_name.- Return type:
This function ignores the
Amtk.Factory:default-flagsproperty and takes the flags argument instead.Note that since it is a
Gtk.CheckMenuItemthe 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.MenuItemfor 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.MenuItemfor action_name.- Return type:
This function ignores the
Amtk.Factory:default-flagsproperty and takes the flags argument instead.Creates a new
Gio.MenuItemfor 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.MenuItemfor action_name.- Return type:
Creates a new
Gtk.MenuItemfor 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.MenuItemfor action_name.- Return type:
This function ignores the
Amtk.Factory:default-flagsproperty and takes the flags argument instead.New in version 3.0.
- Parameters:
action_name (
str) – an action name.- Returns:
a new
Gtk.MenuToolButtonfor action_name.- Return type:
Creates a new
Gtk.MenuToolButtonfor 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.MenuToolButtonfor action_name.- Return type:
This function ignores the
Amtk.Factory:default-flagsproperty and takes the flags argument instead.After calling this function, you need to use the
Gtk.MenuToolButtonAPI 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.ShortcutsShortcutfor 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.ShortcutsShortcutfor action_name.- Return type:
This function ignores the
Amtk.Factory:default-flagsproperty and takes the flags argument instead.This function creates a new
Gtk.ShortcutsShortcutfor 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_TOOLTIPandAmtk.FactoryFlags.IGNORE_LABELflags.The
Gtk.ShortcutsShortcut:acceleratorproperty is set with only the *first* accel returned byAmtk.ActionInfo.get_accels(). This step can be ignored withAmtk.FactoryFlags.IGNORE_ACCELSorAmtk.FactoryFlags.IGNORE_ACCELS_FOR_DOC.The
Gtk.ShortcutsShortcut:action-nameproperty is set to action_name if theAmtk.FactoryFlags.IGNORE_GACTIONflag isn’t set. Note that withGtk.ShortcutsShortcut:action-nameall 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.ActionInfoEntrystructs.- Returns:
a new simple
Gtk.Menufor 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.ActionInfoEntrystructs.flags (
Amtk.FactoryFlags) –Amtk.FactoryFlags.
- Returns:
a new simple
Gtk.Menufor entries.- Return type:
This function ignores the
Amtk.Factory:default-flagsproperty and takes the flags argument instead.This function:
Creates a
Gtk.Menu;For each
Amtk.ActionInfoEntryaction name from entries, creates aGtk.MenuItemwithAmtk.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.Menucontains 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.ToolButtonfor action_name.- Return type:
Creates a new
Gtk.ToolButtonfor 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.ToolButtonfor action_name.- Return type:
This function ignores the
Amtk.Factory:default-flagsproperty 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-flagsproperty.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.Factoryhas 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.