#!/bin/python
#
# An example of a pipe menu using obxml
#
import obxml
#creates the ObMenu class
my_menu = obxml.ObMenu()
#initializes a new pipe
my_menu.newPipe()
#creates an item in the root menu of the pipe
#
# ( parent, label, action, string-to-execute, index)
#
my_menu.createItem(None, "first item here", "execute", "rox")
#creates another item, and insert it before the other one
my_menu.createItem(None, "Gimp", "execute", "gimp", 0)
#appends a submenu in the root, with ID "new-menu"
my_menu.createMenu(None, "New submenu", "new-submenu")
#Now append an item in the new submenu:
my_menu.createItem("new-submenu", "XMMS", "execute", "xmms")
#prints the menu. our pipe menu is done!
my_menu.printXML()
#you can also save the pipe menu:
my_menu.saveMenu("my_menu.xml")