Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: stardust on March 02, 2007, 10:43:36 am

Title: Plugin::BuildMenu (wxMenuBar*) never gets called [resolved]
Post by: stardust on March 02, 2007, 10:43:36 am
Hi,

in a plugin, I intend to make changes to the main menu.

The plugin compiles and can be installed without problems and appears in the "Plugins" submenu. I created the plugin with a wizard and checked the "plugin changes menu" box.

However, the auto-created method ::BuildMenu(wxMenuBar*) never gets called even though I can see the "Updating menu..." progress bar.

I rather expected adding/removing menu items, toolbottons and the like in ::OnAttach/::OnDetach, i.e. when initializing/deinitializing the plugin. Even if ::BuildMenu was called I would not know wether I had to add the items or to remove them...

This applies to both under linux and windows. So I obviously have some misunderstandings of what a plugin is or what is not, and what it's limitations are?

svn is 3655 (linux) resp. 3652 (win)

Title: Re: Plugin::BuildMenu (wxMenuBar*) never gets called
Post by: mandrav on March 02, 2007, 01:02:13 pm
Your plugin inherits from cbToolPlugin. This plugin type doesn't receive events for menus/toolbar. Change your plugin class to inherit from cbPlugin if you want full access.
Title: Re: Plugin::BuildMenu (wxMenuBar*) never gets called
Post by: stardust on March 02, 2007, 01:43:49 pm
Thanks, that's it!

Works fine now.