I have a question, I'm building an application in which a popup menu has to be generated on the fly depending of the data being read from an xml file.
The first part is very simple and I have the items in an array and now I want to add them to an existing menu.
Some variables I use just so it all makes sense.
popup_left_menu_plugin: menuitem in a popup in which the other items should be placed
popup_menu_plugins: is an array that will hold the menuitems
tool_command: is a dictionary with the items to be added
Expand|Select|Wrap|Line Numbers
- for tool in tool_command.keys():
- if str(len(tool)) != "0":
- self.popup_menu_plugins.append(gtk.MenuItem(tool))
- for tools in self.popup_menu_plugins:
- self.popup_left_menu_plugin.set_submenu(tools)
Thx in advance