Hi Benoit,
Benoît Minisini wrote: > > If CurrentUser, CurrentProject and CurrentSystem are the objects that > change, > then they should raise the events, not the module where they are declared. > Shouldn't they? An event is the way an object tells the world it has > changed. > > If you can't, then there is something not clear in your design. > Actually, it was something unclear in my explanation. Its the whole instance that gets changed, for example, FReconnect allows the user to change the CurrentProject. So before it exits, we have <code>env.CurrentProject = selectedProject</code> where selectedProject is a Project instance and env has a Property CurrentProject and <code>PRIVATE SUB CurrentProject_Write(Value AS Project) $currentProject = Value END</code> In other words, I am overwriting the whole instance in "env" (or providing a new replacement pointer, if you prefer). So, more specifically, $currentProject doesn't "know" it's been "replaced". Benoît Minisini wrote: > Anyway, you can register your listeners in an object array in your module, > and > call specific procedures of these object references when something change. > It's more like some sort of "bus". > > I did that in the IDE. For example, when the project state changes (a new > project is loaded, the project enters debugging mode, and so on...), the > same > procedure is called on all opened forms. > This sounds like what I may be looking for! Could you provide a bit more of a clue where to look as there is a lot of good stuff in the IDE project... but there is quite a lot of code too! Finally, just out of interest, why can't modules raise events? Regards, bruce -- View this message in context: http://old.nabble.com/Modules-cant-raise-events-%3A-%28-tp27104759p27105479.html Sent from the gambas-user mailing list archive at Nabble.com. ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user