Functions¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- Parameters:
widget (
Gtk.Widget
) – AGtk.MenuItem
that may have a cachedDbusmenu.Menuitem
from the parser- Returns:
A pointer to the cached item or
None
if it isn’t there.- Return type:
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.
- Parameters:
widget (
Gtk.Widget
) – AGtk.MenuItem
orGtk.MenuShell
to turn into aDbusmenu.Menuitem
- Returns:
A dbusmenu item representing the menu structure
- Return type:
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.
- Parameters:
menuitem (
Dbusmenu.Menuitem
) – TheDbusmenu.Menuitem
to look for the property onproperty (
str
) – The name of the property to look for.
- Returns:
A pixbuf or
None
to signal error.- Return type:
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.
- Parameters:
menuitem (
Dbusmenu.Menuitem
) – TheDbusmenu.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.
- Parameters:
menuitem (
Dbusmenu.Menuitem
) – TheDbusmenu.Menuitem
to set the property on.property (
str
) – Name of the property to set.data (
GdkPixbuf.Pixbuf
) – The image to place on the property.
- Returns:
Whether the function was able to set the property or not.
- Return type:
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.
- Parameters:
menuitem (
Dbusmenu.Menuitem
) – TheDbusmenu.Menuitem
to set the shortcut onkey (
int
) – The keycode of the key to sendmodifier (
Gdk.ModifierType
) – A bitmask of modifiers used to activate the item
- Returns:
Whether it was successful at setting the property.
- Return type:
Takes the modifer described by key and modifier and places that into the format sending across Dbus for shortcuts.
- Parameters:
menuitem (
Dbusmenu.Menuitem
) – TheDbusmenu.Menuitem
to set the shortcut ongmi (
Gtk.MenuItem
) – A menu item to steal the shortcut off of
- Returns:
Whether it was successful at setting the property.
- Return type:
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.
- Parameters:
menuitem (
Dbusmenu.Menuitem
) – TheDbusmenu.Menuitem
to set the shortcut onshortcut (
str
) – String describing the shortcut
- Returns:
Whether it was successful at setting the property.
- Return type:
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.