diff clients/pychan_demo/dynamic.py @ 157:bb9902910067

input_rework merged! Bad features: * Broken DND for zero-projekt. * Design short-comings.
author phoku@33b003aa-7bff-0310-803a-e67f0ece8222
date Tue, 14 Oct 2008 07:41:48 +0000
parents 97d6946bd917
children 51cc05d862f2
line wrap: on
line diff
--- a/clients/pychan_demo/dynamic.py	Sun Oct 12 20:30:09 2008 +0000
+++ b/clients/pychan_demo/dynamic.py	Tue Oct 14 07:41:48 2008 +0000
@@ -19,15 +19,35 @@
 
 from pychan_test import PyChanExample
 
+class Test(object):
+	def __init__(self,button,text1,text2):
+		super(Test,self).__init__()
+		self.button = button
+		self.text1 = text1
+		self.text2 = text2
+		self.button.text = text1
+
+	def mouseEntered(self, event):
+		print event
+		self.button.text = self.text2
+
+	def mouseExited(self, event):
+		print event
+		self.button.text = self.text1
+
+
 class DynamicExample(PyChanExample):
 	def __init__(self):
 		super(DynamicExample,self).__init__('gui/dynamic.xml')
 		
 	def start(self):
 		self.widget = pychan.loadXML(self.xmlFile)
+		self.l = Test(self.widget.findChild(name="okButton"),"Ok?","Ok!")
 		self.widget.mapEvents({
 			'okButton'   :self.stop,
 			'addButton'  :self.addLabel,
+			'okButton/mouseEntered' : self.l.mouseEntered,
+			'okButton/mouseExited'  : self.l.mouseExited
 		})
 		self.labelBox = self.widget.findChild(name="labelBox")
 		self.widget.show()