Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Tk_link_events.py
- from Tkinter import *
- def demo():
- def click_link(event, text):
- print("You clicked '%s'" % text)
- for text in ("link #1", "link #2", "link #3"):
- link = Label(text=text, foreground="#0000ff")
- link.bind("<1>", lambda event, text=text: click_link(event, text))
- link.pack()
- root = Tk()
- demo()
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement