Package Gnumed :: Package wxpython :: Module gmPlugin_Patient :: Class BasePlugin |
[frames] | no frames]

# Class BasePlugin

source code

Base class for all plugins providing wxPython widgets.

Plugins must have a class descending of this class in their file, which MUST HAVE THE SAME NAME AS THE FILE.

The file must be in a directory which is loaded by LoadPluginSet (gui/ for the moment, others may be added for different plugin types)

Instance Methods
__init__(self, set='', guibroker=None, callbackbroker=None, params=None) | source code
GetIcon(self) Return icon representing page on the toolbar. | source code
GetIconData(self, anIconID=None) | source code
GetWidget(self, parent) Return the widget to display. | source code
MenuInfo(self) Return tuple of (menuname, menuitem). | source code
Raise(self) Raises this plugin to the top level if not visible. | source code
ReceiveFocus(self) Called whenever this module receives focus and is thus shown onscreen. | source code
register(self) | source code
unregister(self) | source code
name(self) | source code

Method Details

### GetIcon(self) | source code
Return icon representing page on the toolbar. This is the default behaviour. GetIconData should return pickled, compressed and escaped string with the icon data. If you want to change the behaviour (because you want to load plugin icons from overseas via a satellite link or something you need to override this function in your plugin (class). Using this standard code also allows us to only import cPickle and zlib here and not in each and every plugin module which should speed up plugin load time :-)

### GetWidget(self, parent) | source code
Return the widget to display. Usually called from register(). The instance returned is the active object for event handling purposes.

### MenuInfo(self) | source code
    Return tuple of (menuname, menuitem).

    menuname can be
            "tools",
            "view",
            "help",
            "file"

    If you return "None" no entry will be placed
    in any menu.