Branch: refs/heads/working
Home: https://github.com/dabodev/dabo
Commit: d56aab300295a40427d68cb8a28d2e60c86fb99f
https://github.com/dabodev/dabo/commit/d56aab300295a40427d68cb8a28d2e60c86fb99f
Author: Paul McNett <[email protected]>
Date: 2013-01-29 (Tue, 29 Jan 2013)
Changed paths:
M dabo/lib/eventMixin.py
Log Message:
-----------
Fix autoBindEvents to work with Name.
This has bugged me for a long time. I code up a panel that has a
bunch of subobjects, and I want the panel to respond to the events
of the subobjects. Something like:
```python
class Pnl(dabo.ui.dPanel):
def afterInit(self):
dabo.ui.dButton(self, Caption="hi", Name="but1")
def onHit_but1(self, evt):
print "hi"
```
Previously, that onHit_but1 handler wouldn't get called, because
I set the Name of the button, not the RegID. It doesn't make sense
to set the RegID of the button, since the form has no business
even knowing it exists. And I don't want to have to explicitly
bind the event because I'm lazy and like simple code.
This commit fixes the autoBindEvents() to use the RegID if it is
set, but Name otherwise.
--- StripMime Report -- processed MIME parts ---
multipart/mixed
text/plain (text body -- kept)
---
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message:
http://leafe.com/archives/byMID/[email protected]