module documentation
(source)

Class ActionClassMethod Undocumented
Class ActionDescriptor Undocumented
Class ActionMethod Undocumented
Class BoundActionMethod Undocumented
Class RadioActionClassMethod Undocumented
Class RadioActionMethod Undocumented
Class ToggleActionClassMethod Toggle action, used by the toggle_action decorator
Class ToggleActionMethod No class docstring; 0/2 instance variable, 0/2 class variable, 3/9 methods documented
Function action No summary
Function get_actions Returns bound actions for object
Function get_gtk_actiongroup Return a Gtk.ActionGroup for an object using Action objects as attributes.
Function gtk_radioaction_set_current Undocumented
Function hasaction Like hasattr but for attributes that define an action
Function initialize_actiongroup Undocumented
Function radio_action Undocumented
Function radio_option Undocumented
Function toggle_action Decorator to turn a method into an ToggleActionMethod object
Constant PRIMARY_MODIFIER_MASK Undocumented
Constant PRIMARY_MODIFIER_STRING Undocumented
Variable Gio Undocumented
Variable GLib Undocumented
Variable Gtk Undocumented
Variable logger Undocumented
Function _get_modifier_mask Undocumented
Function _gtk_add_action_with_accel Undocumented
def action(label, accelerator='', icon=None, verb_icon=None, menuhints='', alt_accelerator=None, tooltip=None): (source)
Decorator to turn a method into an ActionMethod object Methods decorated with this decorator can have keyword arguments but no positional arguments.
Parameters
labelthe label used e.g for the menu item (can use "_" for mnemonics)
acceleratoraccelerator key description
iconname of a "noun" icon - used together with the label. Only use this for "things and places", not for actions or commands, and only if the icon makes the item easier to recognize.
verb_iconname of a "verb" icon - only used for compact menu views
menuhintsstring with hints for menu placement and sensitivity
alt_acceleratoralternative accelerator key binding
tooltiptooltip label, defaults to label
def get_actions(obj): (source)

Returns bound actions for object

NOTE: See also zim.plugins.list_actions() if you want to include actions of plugin extensions

def get_gtk_actiongroup(obj): (source)

Return a Gtk.ActionGroup for an object using Action objects as attributes.

Defines the attribute obj.actiongroup if it does not yet exist.

This method can only be used when gtk is available

def gtk_radioaction_set_current(g_radio_action, key): (source)

Undocumented

def hasaction(obj, actionname): (source)
Like hasattr but for attributes that define an action
def initialize_actiongroup(obj, prefix): (source)

Undocumented

def radio_action(menulabel, *radio_options, menuhints=''): (source)

Undocumented

def radio_option(key, label, accelerator=''): (source)

Undocumented

def toggle_action(label, accelerator='', icon=None, verb_icon=None, init=False, menuhints='', tooltip=None): (source)

Decorator to turn a method into an ToggleActionMethod object

The decorated method should be defined as: my_toggle_method(self, active). The 'active' parameter is a boolean that reflects the new state of the toggle.

Users can also call the method without setting the active parameter. In this case the wrapper determines how to toggle the state and calls the inner function with the new state.

Parameters
labelthe label used e.g for the menu item (can use "_" for mnemonics)
acceleratoraccelerator key description
iconname of a "noun" icon - used together with the label. Only use this for "things and places", not for actions or commands, and only if the icon makes the item easier to recognize.
verb_iconname of a "verb" icon - only used for compact menu views
initinitial state of the toggle
menuhintsstring with hints for menu placement and sensitivity
tooltiptooltip label, defaults to label
PRIMARY_MODIFIER_MASK = (source)

Undocumented

Value
_get_modifier_mask()
PRIMARY_MODIFIER_STRING: str = (source)

Undocumented

Value
'<Primary>'

Undocumented

GLib = (source)

Undocumented

Undocumented

logger = (source)

Undocumented

def _get_modifier_mask(): (source)

Undocumented

def _gtk_add_action_with_accel(obj, actiongroup, action, attr, accel): (source)

Undocumented