Functions

  gtk_parse_get_cached_item (widget)
  gtk_parse_menu_structure (widget)
  menuitem_property_get_image (menuitem, property)
  menuitem_property_get_shortcut (menuitem)
  menuitem_property_set_image (menuitem, property, data)
  menuitem_property_set_shortcut (menuitem, key, modifier)
  menuitem_property_set_shortcut_menuitem (menuitem, gmi)
  menuitem_property_set_shortcut_string (menuitem, shortcut)

Details

DbusmenuGtk3.gtk_parse_get_cached_item(widget)
Parameters:widget (Gtk.Widget) – A Gtk.MenuItem that may have a cached Dbusmenu.Menuitem from the parser
Returns:A pointer to the cached item or None if it isn’t there.
Return type:Dbusmenu.Menuitem

The Dbusmenu GTK parser adds cached items on the various menu items throughout the tree. Sometimes it can be useful to get that cached item to use directly. This function will retrieve it for you.

DbusmenuGtk3.gtk_parse_menu_structure(widget)
Parameters:widget (Gtk.Widget) – A Gtk.MenuItem or Gtk.MenuShell to turn into a Dbusmenu.Menuitem
Returns:A dbusmenu item representing the menu structure
Return type:Dbusmenu.Menuitem

Goes through the GTK structures and turns them into the appropraite Dbusmenu structures along with setting up all the relationships between the objects. It also stores the dbusmenu items as a cache on the GTK items so that they’ll be reused if necissary.

DbusmenuGtk3.menuitem_property_get_image(menuitem, property)
Parameters:
Returns:

A pixbuf or None to signal error.

Return type:

GdkPixbuf.Pixbuf

This function looks on the menu item for a property by the name of property. If one exists it tries to turn it into a GdkPixbuf.Pixbuf. It assumes that the property is a base64 encoded PNG file like the one created by #dbusmenu_menuite_property_set_image.

DbusmenuGtk3.menuitem_property_get_shortcut(menuitem)
Parameters:menuitem (Dbusmenu.Menuitem) – The Dbusmenu.Menuitem to get the shortcut off
Returns:
key:Location to put the key value
modifier:Location to put the modifier mask
Return type:(key: int, modifier: Gdk.ModifierType)

This function gets a GTK shortcut as a key and a mask for use to set the accelerators.

DbusmenuGtk3.menuitem_property_set_image(menuitem, property, data)
Parameters:
Returns:

Whether the function was able to set the property or not.

Return type:

bool

This function takes the pixbuf that is stored in data and turns it into a base64 encoded PNG so that it can be placed onto a standard Dbusmenu.Menuitem property.

DbusmenuGtk3.menuitem_property_set_shortcut(menuitem, key, modifier)
Parameters:
Returns:

Whether it was successful at setting the property.

Return type:

bool

Takes the modifer described by key and modifier and places that into the format sending across Dbus for shortcuts.

DbusmenuGtk3.menuitem_property_set_shortcut_menuitem(menuitem, gmi)
Parameters:
Returns:

Whether it was successful at setting the property.

Return type:

bool

Takes the shortcut that is installed on a menu item and calls DbusmenuGtk3.menuitem_property_set_shortcut with it. It also sets up listeners to watch it change.

DbusmenuGtk3.menuitem_property_set_shortcut_string(menuitem, shortcut)
Parameters:
Returns:

Whether it was successful at setting the property.

Return type:

bool

This function takes a GTK shortcut string as defined in Gtk.accelerator_parse and turns that into the information required to send it over DBusmenu.