dabo Commit
Revision 6760
Date: 2011-08-08 12:10:51 -0700 (Mon, 08 Aug 2011)
Author: Paul
Trac: http://trac.dabodev.com/changeset/6760
Changed:
U trunk/dabo/ui/uitk/__init__.py
U trunk/dabo/ui/uitk/test.py
U trunk/dabo/ui/uitk/uiApp.py
Log:
Added test code to tk to show events basically working.
Diff:
Modified: trunk/dabo/ui/uitk/__init__.py
===================================================================
--- trunk/dabo/ui/uitk/__init__.py 2011-08-08 18:52:01 UTC (rev 6759)
+++ trunk/dabo/ui/uitk/__init__.py 2011-08-08 19:10:51 UTC (rev 6760)
@@ -75,6 +75,8 @@
def getEventData(uiEvent):
ed = {}
+ if isinstance(uiEvent, dabo.dEvents.dEvent):
+ return ed
ed["mousePosition"] = (uiEvent.x, uiEvent.y)
if "shift_" in uiEvent.keysym.lower():
Modified: trunk/dabo/ui/uitk/test.py
===================================================================
--- trunk/dabo/ui/uitk/test.py 2011-08-08 18:52:01 UTC (rev 6759)
+++ trunk/dabo/ui/uitk/test.py 2011-08-08 19:10:51 UTC (rev 6760)
@@ -50,14 +50,17 @@
label = ui.dLabel(panel)
label.Width = labelWidth
- object = objClass(panel)
- label.Caption = "%s:" % object.Name
+ obj = objClass(panel)
+ obj.bindEvent(dabo.dEvents.Hit, self.objHit)
+ label.Caption = "%s:" % objClass.__name__
- object.debug = True
- object.LogEvents = ["All"]
+ obj.debug = True
+ obj.LogEvents = ["All"]
self.app.start()
+ def objHit(self, evt):
+ print "hit!", evt
if __name__ == "__main__":
t = Test()
Modified: trunk/dabo/ui/uitk/uiApp.py
===================================================================
--- trunk/dabo/ui/uitk/uiApp.py 2011-08-08 18:52:01 UTC (rev 6759)
+++ trunk/dabo/ui/uitk/uiApp.py 2011-08-08 19:10:51 UTC (rev 6760)
@@ -28,6 +28,9 @@
self.raiseEvent(dEvents.Activate)
Tkinter.mainloop()
+ def exit(self):
+ return
+
def finish(self):
self.raiseEvent(dEvents.Deactivate)
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message:
http://leafe.com/archives/byMID/[email protected]