RB.Application

g GObject.GInterface GObject.GInterface Gio.ActionGroup Gio.ActionGroup GObject.GInterface->Gio.ActionGroup Gio.ActionMap Gio.ActionMap GObject.GInterface->Gio.ActionMap GObject.Object GObject.Object Gio.Application Gio.Application GObject.Object->Gio.Application Gio.ActionGroup->Gio.Application Gio.ActionMap->Gio.Application Gtk.Application Gtk.Application Gio.Application->Gtk.Application RB.Application RB.Application Gtk.Application->RB.Application

Subclasses:None

Methods

Inherited:Gtk.Application (21), Gio.Application (37), GObject.Object (37), Gio.ActionGroup (14), Gio.ActionMap (4)
Structs:GObject.ObjectClass (5)
class new ()
  activate_key (event)
  add_accelerator (accel, action, parameter)
  add_plugin_menu_item (menu, id, item)
  add_shared_menu (name, menu)
  get_plugin_menu (menu)
  get_shared_menu (name)
  link_shared_menus (menu)
  remove_plugin_menu_item (menu, id)
  run (argc, argv)
  set_menu_accelerators (menu, enable)

Properties

Inherited:Gtk.Application (5), Gio.Application (8)
Name Type Flags Short Description
shell RB.Shell r RB.Shell instance

Fields

Inherited:Gtk.Application (3), Gio.Application (7), GObject.Object (1), Gio.ActionGroup (4)
Name Type Access Description
parent Gtk.Application r  

Class Details

class RB.Application(**kwargs)
Bases:Gtk.Application
Abstract:No
Structure:RB.ApplicationClass
classmethod new()
Returns:application instance
Return type:Gio.Application

Creates the application instance.

activate_key(event)
Parameters:event (Gdk.EventKey) – a Gdk.EventKey
Returns:True if an accelerator was activated
Return type:bool

Attempts to activate an accelerator registered using RB.Application.add_accelerator.

add_accelerator(accel, action, parameter)
Parameters:
  • accel (str) – accelerator string
  • action (str) – the name of the action to activate
  • parameter (GLib.Variant or None) – parameter to pass when activating the action, or None if the action does not accept an activation parameter.

Like Gtk.Application.add_accelerator, except the accelerator only applies if the key was not handled by the focused widget.

add_plugin_menu_item(menu, id, item)
Parameters:
  • menu (str) – name of the menu to add to
  • id (str) – id of the item to add (used to remove it, must be unique within the menu)
  • item (Gio.MenuItem) – menu item to add

Adds an item to a plugin menu. The id can be used to remove the item.

add_shared_menu(name, menu)
Parameters:

Adds a menu model to the set of shared menus available for linking into other menus.

get_plugin_menu(menu)
Parameters:menu (str) – name of plugin menu to return
Returns:plugin menu instance.
Return type:Gio.MenuModel

Returns a plugin menu instance. Plugin menus are like shared menus except they are created empty on first access, and they consist solely of entries added through rb_application_add_plugin_item.

get_shared_menu(name)
Parameters:name (str) – name of menu to return
Returns:menu model instance, or None if not found
Return type:Gio.MenuModel

Returns a shared menu instance added with rb_application_add_shared_menu

Parameters:menu (Gio.Menu) – a Gio.Menu to process

Processes shared menu links in the given menu. Menu links take the form of items with “rb-menu-link” or “rb-plugin-menu-link” and “rb-menu-link-type” attributes. “rb-menu-link” specifies the name of a shared menu to link in, “rb-plugin-menu-link” specifies the name of a plugin menu to link in, “rb-menu-link-type” specifies the link type, either “section” or “submenu”. A link item must have “rb-menu-link-type” and one of “rb-menu-link” or “rb-plugin-menu-link”.

remove_plugin_menu_item(menu, id)
Parameters:
run(argc, argv)
Parameters:
  • argc (int) – arg count
  • argv (str) – arg values
Returns:

exit code

Return type:

int

Runs the application

set_menu_accelerators(menu, enable)
Parameters:

Enables or disables accelerators for items in menu.

Property Details

RB.Application.props.shell
Name:shell
Type:RB.Shell
Default Value:None
Flags:READABLE

RB.Shell instance