Package gui :: Module menu :: Class Uf_menus
[hide private]
[frames] | no frames]

Class Uf_menus

source code

A class for the creation of specialised menu entries for the user functions.

Instance Methods [hide private]
 
__init__(self, parent=None, menu=None)
Set up the menu entries.
source code
long
add_class(self, name=None, text=None, icon=None)
Add the user function.
source code
long
add_uf(self, parent_id=None, name=None, text=None, icon=None, fn=None)
Add the user function.
source code
 
call(self, event)
Execute the given user function.
source code
Method Details [hide private]

__init__(self, parent=None, menu=None)
(Constructor)

source code 

Set up the menu entries.

Parameters:
  • parent (wx.Window instance) - The parent window.
  • menu (wx.Menu instance) - The menu to add to.

add_class(self, name=None, text=None, icon=None)

source code 

Add the user function.

Parameters:
  • name (str) - The name of the user function, such as 'residue.delete'.
  • text (str) - The menu text string.
  • icon (str or None) - The path to the icon image file for the menu entry.
Returns: long
The menu ID number.

add_uf(self, parent_id=None, name=None, text=None, icon=None, fn=None)

source code 

Add the user function.

Parameters:
  • parent_id (long) - The unique ID number of the parent menu entry.
  • name (str) - The name of the user function, such as 'residue.delete'.
  • text (str) - The menu text string.
  • icon (str or None) - The path to the icon image file for the menu entry.
  • fn (func) - The user function to execute.
Returns: long
The menu ID number.

call(self, event)

source code 

Execute the given user function.

Parameters:
  • event (wx event) - The wx event.