comparison 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
comparison
equal deleted inserted replaced
165:fbc55c6f57cf 166:81a222e7bd25
642 *DEPRECATED* 642 *DEPRECATED*
643 643
644 Callback is called when mouse enters the area of Widget 644 Callback is called when mouse enters the area of Widget
645 callback should have form of function(button) 645 callback should have form of function(button)
646 """ 646 """
647 if cb is None:
648 self.capture(None, event_name = "mouseEntered" )
649 return
650
647 def callback(widget=None): 651 def callback(widget=None):
648 return cb(widget) 652 return cb(widget)
649 print "PyChan: You are using the DEPRECATED functionality: setEnterCallback." 653 print "PyChan: You are using the DEPRECATED functionality: setEnterCallback."
650 self.capture(callback, event_name = "mouseEntered" ) 654 self.capture(callback, event_name = "mouseEntered" )
651 655
654 *DEPRECATED* 658 *DEPRECATED*
655 659
656 Callback is called when mouse exits the area of Widget 660 Callback is called when mouse exits the area of Widget
657 callback should have form of function(button) 661 callback should have form of function(button)
658 """ 662 """
663 if cb is None:
664 self.capture(None, event_name = "mouseExited" )
665 return
666
659 def callback(widget=None): 667 def callback(widget=None):
660 return cb(widget) 668 return cb(widget)
661 print "PyChan: You are using the DEPRECATED functionality: setExitCallback." 669 print "PyChan: You are using the DEPRECATED functionality: setExitCallback."
662 self.capture(callback, event_name = "mouseExited" ) 670 self.capture(callback, event_name = "mouseExited" )
663 671