On 04/15/2011 10:57 PM, Paul McNett wrote: > > Not sure the documentation will be much help here, unless there are wiki > pages I'm > unaware of. > > To create a custom event: > > class MyCustomEvent(dabo.dEvent): pass > > To bind to it: > > class MyTextBox(dabo.ui.dTextBox): > def initEvents(self): > self.bindEvent(MyCustomEvent, self.onMyCustomEvent) > > def onMyCustomEvent(self, evt): > print "hi", evt.EventData > > This is simplistic, meant to get you started. > > Thank you, and hopefully my code isn't too simplistic, but you have to start > somewhere! > This is great help indeed. I'll read a bit more into the classes and poke around the code that uses them to get a feel of the specifics, thanks! Maybe I'll throw some dExceptions around for errors and see how they behave too.
Just one more thing if I may: Since my protocol/connection class will have to raise and respond to events, what should I include as a subclass to get the bindEvent/raiseEvent functionality? I'm guessing here some of the MixIn classes? Any particular thing I should make sure to call on the subclass when initializing? Nick _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/[email protected]
