diff engine/extensions/pychan/widgets.py @ 166:81a222e7bd25

Fixes for event handling.
author phoku@33b003aa-7bff-0310-803a-e67f0ece8222
date Sat, 18 Oct 2008 06:46:21 +0000
parents 5b04a7d3ded6
children 3fb17daa1b27
line wrap: on
line diff
--- a/engine/extensions/pychan/widgets.py	Wed Oct 15 18:04:52 2008 +0000
+++ b/engine/extensions/pychan/widgets.py	Sat Oct 18 06:46:21 2008 +0000
@@ -644,6 +644,10 @@
 		Callback is called when mouse enters the area of Widget
 		callback should have form of function(button)
 		"""
+		if cb is None:
+			self.capture(None, event_name = "mouseEntered" )
+			return
+
 		def callback(widget=None):
 			return cb(widget)
 		print "PyChan: You are using the DEPRECATED functionality: setEnterCallback."
@@ -656,6 +660,10 @@
 		Callback is called when mouse exits the area of Widget
 		callback should have form of function(button)
 		"""
+		if cb is None:
+			self.capture(None, event_name = "mouseExited" )
+			return
+
 		def callback(widget=None):
 			return cb(widget)
 		print "PyChan: You are using the DEPRECATED functionality: setExitCallback."