Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Feedback needed for change in plugins' event handling
David Perfors:
It is indeed a lot better then the macro stuff of Code::Blocks. It is strange that wx can't guarantee that the event isn't fired once... (I think you are saying that indirectly..)
dmoore:
sounds good to me.
will you also set this up for all of the plugin virtuals (other than OnAttach and OnRelease)? The registration of methods like BuildMenu and BuildModuleMenu could then go into the boiler plate for the plugin wizard, which will be a nice signpost for new users.
mandrav:
--- Quote from: dmoore on July 05, 2007, 03:18:31 pm ---sounds good to me.
will you also set this up for all of the plugin virtuals (other than OnAttach and OnRelease)? The registration of methods like BuildMenu and BuildModuleMenu could then go into the boiler plate for the plugin wizard, which will be a nice signpost for new users.
--- End quote ---
BuildMenu and friends are not events so no, they won't be handled this way.
But after this system is implemented, we could add a new page to the plugin wizard to allow the user to (multiple-)select from all the core events and add code appropriately.
dmoore:
--- Quote from: mandrav on July 05, 2007, 03:41:56 pm ---BuildMenu and friends are not events so no, they won't be handled this way.
--- End quote ---
isn't the distinction artificial? (i.e. buildmenu, buildmodulemenu etc could be setup as events, passing the menu data in the event structure). However, given the time and minimal breakage constraints, I understand the decision (I just like consistency).
--- Quote ---But after this system is implemented, we could add a new page to the plugin wizard to allow the user to (multiple-)select from all the core events and add code appropriately.
--- End quote ---
:)
rickg22:
I support the motion. For one reason: Rogue plugins.
Have you noticed, for example, that many plugins have the if(isAttached()) code included in their handlers? What if i make a plugin virus and i don't care if the plugin's attached or not, and execute the event handling? So yes, we need to activate the event handling only AFTER the plugin's attached. But please unregister the events automatically so the plugin writer won't have to unregister their plugins.
One thing, tho. I don't think "RegisterEventSink" is an appropriate name. How about "RegisterCBEventHandler"? :)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version