Package screenlets :: Module menu
[hide private]
[frames] | no frames]

Module menu

source code

Classes [hide private]
  ApplicationMenu
A utility-class to simplify the creation of gtk.Menus from directories with desktop-files.
  DefaultMenuItem
A container with constants for the default menuitems
  ImageMenuItem
A menuitem with a custom image and label.
Functions [hide private]
 
_(s) source code
 
add_menuitem(menu, label, callback=None, cb_data=None)
Convenience function to create a menuitem, connect a callback, and add the menuitem to menu.
source code
 
add_image_menuitem(menu, stock, label=None, callback=None, cb_data=None)
Convenience function to create an ImageMenuItem, connect a callback, and add the menuitem to menu.
source code
 
add_menuitem_with_item(menu, item, callback=None, cb_data=None)
Convenience function to add a menuitem to a menu and connect a callback.
source code
 
create_menu_from_file(filename, callback)
Creates a menu from an XML-file and returns None if something went wrong
source code
 
create_menu_from_xml(node, callback, icon_size=22)
Create a gtk.Menu by an XML-Node
source code
 
fill_menu_from_directory(dirname, menu, callback, filter='*', id_prefix='', id_suffix='', search=[], replace=[], skip=[])
Create MenuItems from a directory.
source code
 
imageitem_from_name(filename, label, icon_size=32)
Creates a new gtk.ImageMenuItem from a given icon/filename.
source code
 
read_desktop_file(filename)
Read ".desktop"-file into a dict NOTE: Should use utils.IniReader ...
source code
Function Details [hide private]

fill_menu_from_directory(dirname, menu, callback, filter='*', id_prefix='', id_suffix='', search=[], replace=[], skip=[])

source code 
Create MenuItems from a directory. TODO: use regular expressions

imageitem_from_name(filename, label, icon_size=32)

source code 
Creates a new gtk.ImageMenuItem from a given icon/filename. If an absolute path is not given, the function checks for the name of the icon within the current gtk-theme.