On mardi 24 juin 2008, Patrik Karlsson wrote: > Hi, since I'm new to Gambas it's a constant struggle, but a nice one that > is. :) > > I'm writng a class, CDiceBoard, that INHERITS Panel. > Everything went ok until it was time to implement some events for my class. > > The following code works, but not the way I want it to be. > --- > DIM hDiceBoard2 AS CDiceBoard > hDiceBoard2 = NEW CDiceBoard(ME) AS "myDiceBoard" > > PUBLIC SUB myDiceBoard_MouseDown() > DEBUG > END > --- > > How can I put the _MouseDown() inside CDiceBoard.class and make it work? > > Regards
The first question is: why do you need to catch MouseDown events inside CDiceBoard class? Anyway, events are intended to the final user of an object. If you need to intercept them inside the implementation of the object class, you have to use Observers. An observer is an object that can intercept any event on any object: look the documentation in the wiki about the Observer class in the gb component. Regards, -- Benoit Minisini ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user