Mouse action: double click,mousedouble,from Tkinter
Mouse action: double click,mousedouble,from Tkinter
from Tkinter import *def showAllEvent(event): print event for attr in dir(event): print attr, '=>', getattr(event, attr) def showPosEvent(event): print 'Widget=%s X=%s Y=%s' % (event.widget, event.x, event.y)def onDoubleLeftClick(event): print 'Got double left mouse click', showPosEvent(event) showAllEvent(event)tkroot = Tk()labelfont = ('courier', 20, 'bold') widget = Label(tkroot, text='Hello bind world')widget.config(bg='red', font=labelfont) widget.config(height=5, width=20) widget.pack(expand=YES, fill=BOTH)widget.bind('<Double-1>', onDoubleLeftClick) widget.focus() tkroot.title('Click Me')tkroot.mainloop()
- Power function,powerfunction,def power(x,
- Print each element in the tuple,elementtuple,inventory
- Two ways to write a table of squares and cubes,squares
- Read a number and do calculation,numbercalculation,num
- Simple XML Document Analysis,simpleanalysis,import sys
- Draw polygon,drawpolygon,from Tkinter
热门文章:
相关内容
- Power function,powerfunction,def power(x,
- Print each element in the tuple,elementtuple,inventory =
- Two ways to write a table of squares and cubes,squarescubes,import
- Read a number and do calculation,numbercalculation,num = raw_in
- Simple XML Document Analysis,simpleanalysis,import sysfr
- Draw polygon,drawpolygon,from Tkinter
- Mouse action: single click, double click,mouseclick,import Tkint
- test for List membership with in,testmembership,inventory =
- Reference dictionary in print function,,print '%(n)d
- Subclassing the Default ContentHandler,,from xml.sax
评论关闭