Package pallavi :: Package plugins :: Module SimpleMenubar
[hide private]
[frames] | no frames]

Module SimpleMenubar

source code

Simple Menubar with built-in actions. Eventually, I suppose it should
be fully customizable, but I'm not even using this thing, so if somebody
likes menubars they can hack this plugin and send me the new version.

This plugin provides the following actions:
BindAction
        To bind an action to a menu item in a specific menu or submenu
BindFunction
        To bind a function to a menu item in a specific menu or submenu
AddSubmenu
    Create a submenu in a menu for actions and functions to bind to

This plugin invokes the following actions:
NewView
NewFile
CloseFIle
OpenFile
SaveActive
SaveActiveAs
        When a menu item is clicked.
        
This plugin listens for the following Events:
ViewCreated
        To add a menubar to the newly created view



Functions [hide private]
 
setup() source code
 
NewView(name, view) source code
 
AddSubmenu(menuname, submenuname, view=None)
When called as and action, creates a submenu with name submenuname in the menu with name menuname.
source code
 
BindMenuAction(menuname, action, view=None, submenuname=None)
Invoked by an action, it will locate the menu by name or else create a new one with that name and bind it to the menubar.
source code
 
BindMenuFunction(menuname, text, function, view=None, submenuname=None)
Invoked by an action, it will locate the menu by name or else create a new one with that name and add it to the menubar.
source code
 
BindAction(menu, action, view)
Convenience method to make the actions bound in the setup method more readable.
source code
 
BindFunction(menu, text, function, view)
Bind a function to a specific menu action.
source code
 
GetMenuOrSubmenu(menuname, submenuname, view)
Utility method called by the BindMenu* actions.
source code
Variables [hide private]
  extraActions = []
  extraFunctions = []
  extraSubmenus = []
Function Details [hide private]

AddSubmenu(menuname, submenuname, view=None)

source code 
When called as and action, creates a submenu with name submenuname in the menu with name menuname. This action doesn't actually bind any actions, it just creates the submenu. Use BindMenuAction with the submenuname argument to bind an action to a submenu

BindMenuAction(menuname, action, view=None, submenuname=None)

source code 
Invoked by an action, it will locate the menu by name or else create a new one with that name and bind it to the menubar. Menuname is the name of the menu for the action to be bound to, and submenuname is and optional argument naming the submenu to bind an action to

BindMenuFunction(menuname, text, function, view=None, submenuname=None)

source code 
Invoked by an action, it will locate the menu by name or else create a new one with that name and add it to the menubar. It will then create a new menu item in that menu with the text and bind it to a function

BindAction(menu, action, view)

source code 
Convenience method to make the actions bound in the setup method more readable. Menu is the menu to add a menuitem to. Action is the name of an action to bind the item to.

BindFunction(menu, text, function, view)

source code 
Bind a function to a specific menu action. Menu is the menu to add an item to. Text is the caption of the menu. function is the name of the function to pass to it. Any remaining arguments will be passed to that function.

GetMenuOrSubmenu(menuname, submenuname, view)

source code 
Utility method called by the BindMenu* actions. Finds or creates a menu or submenu that can have an item appended. Menuname is the name of the menu, submenuname is the name of a submenu in that menu, and view is the view to get a menubar for