On Apr 17, 2011, at 11:22 PM, Nick Raptis wrote: > To my understanding, when you call raiseEvent from somewhere, you just > release it to the wild for any listening handlers to act on it. > Well, not exactly, as http://wiki.dabodev.com/Events suggests that an > event propagates only to the children of the object that raised them.
Events don't really 'propagate'; instead, they are sent to the objects to which they are bound. It's more of a publish/subscribe model rather than a broadcast model. > But I'm stuck for some hours now, and I can't seem to be able to listen > for an event, except when I'm raising it from the same object that listens. > None of the children of the raising object get the event. I believe that is by design (perhaps Paul can chime in). Event bindings are registered with the object that raises the event; you change the handler function if you want a different object to handle the event. In your example, anything that wants to respond to txt1's custom event would have to run the equivalent of: txt1.bindEvent(MyCustomEvent, self.mySpecificHandler) So if you wanted to have the form respond to the event, you have two options: 1) Have the form register with the textbox: self.txt1.bindEvent(MyCustomEvent, self.onMyCustomEvent) 2) Have the textbox's Hit event raise the event in the form, and then bind to that: self.bindEvent(MyCustomEvent, self.onMyCustomEvent) The way I keep things straight is that "bindEvent" registers the handler function with the object that bindEvent is called on; if that object later receives a raiseEvent() for that particular event, it simply calls the bound handler. There is no generic way to listen to one class of events no matter which object raises them. -- Ed Leafe _______________________________________________ Post Messages to: Dabo-users@leafe.com 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/cbccfa49-4770-47bf-b7bb-e7cac1fd9...@leafe.com