Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Tk_mouseover.py
- from Tkinter import *
- root = Tk()
- Canvas(root, height=40, width=180).grid()
- def Submit(event):
- print event
- entry1 = Entry(root)
- entry2 = Entry(root)
- sp = ' '*10
- btn1 = Label(root, text='Hover Over Me', bg='green')
- btn1.bind('<Enter>', lambda e: Submit('Mouse Hovered!'))
- btn2 = Label(root, text=sp+'Click Me'+sp, bg='orange')
- btn2.bind('<Button-1>', lambda e: Submit('Button Clicked!'))
- quit = Button(root, text='Quit', command=root.destroy, bg='grey')
- title = Label(root, text='Tk Mouseover')
- title.grid(row=0, columnspan=2)
- btn1.grid(row=1, column=0, sticky=W+E)
- btn2.grid(row=1, column=1, sticky=W+E)
- quit.grid(row=2, column=1, sticky=W+E)
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement