gnc_plugins

David Hampton hampton at employees.org
Fri Dec 31 14:32:56 EST 2004


On Fri, 2004-12-31 at 14:18 -0500, Chris Shoemaker wrote:

> If I understand correctly, you're saying the plugin's init function
> should add itself to the plugin manager. 

The module's init function should install the plugin into the manager.
When that menu item is invoked, the callback function should use the
gncPluginPage stuff to create a display area and assocuated menu items.

> AFAICS, no plugin works that
> way now.  But, I could try changing that.

I thought there were a bunch, but its been a year since I worked heavily
in this code so I could be wrong.  You can check hbci for an example
though.  The hbci module init function calls
gnc_plugin_hbci_create_plugin which calls gnc_plugin_manager_add_plugin
to add its menu items to the main window.

> > 
> > > > And, while I'm asking about gui stuff... what about gncPlugins
> > > > vs. gnc_menu_extenstion_ stuff?  All the Reports menu stuff uses
> > > > gnc_menu_extensions and no gncPlugin at all.  
> > > 
> > > gncPlugin is a new-in-g2 api; the gnc_menu_extension is the older
> > > interface.  There's no reason to use one vs. the other as far as I
> > > know.
> > 
> > gncPlugin creates menu items that exist in all top level windows.
> > gncPluginPage creates menus that apply only to a particular page within
> > a window.  Using the plugins (and underlying action objects) its easier
> > to enable/disable menu/toolbar items that it is with the
> > gnc_menu_extension interface.
> > 
> 
> That seems like a good reason to prefer gncPlugin.  Are there downsides?

The XML menu description/placement code is a little klunky.  Its all
hand done ATM.  Don't know if more recent versions of glade support
creating this stuff.  I've been out of the loop for a while.

David

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20041231/7f938fc5/attachment.bin


More information about the gnucash-devel mailing list