Button single click and double click : Mouse Action : Event PYTHON examples


PYTHON examples » Event » Mouse Action »

 

Button single click and double click


Button single click and double click


from Tkinter import *

def hello(event):
    print 'Press twice to exit'              

def quit(event):                             
    print 'Hi...'        
    import sys; sys.exit() 

widget = Button(None, text='Hello event world')
widget.pack()
widget.bind('<Button-1>', hello)             
widget.bind('<Double-1>', quit)              
widget.mainloop()

           
       



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo Event
» Mouse Action