Advertisement
Guest User

Tkinter Hyperlink Manager Module (GUI code)

a guest
Aug 3rd, 2010
1,187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. import tkHyperlinkManager
  2.  
  3. from Tkinter import *
  4.  
  5. root = Tk()
  6. root.title("hyperlink-1")
  7.  
  8. text = Text(root)
  9. text.pack()
  10.  
  11. hyperlink = tkHyperlinkManager.HyperlinkManager(text)
  12.  
  13. def click1():
  14.     print "click 1"
  15.  
  16. text.insert(INSERT, "this is a ")
  17. text.insert(INSERT, "link", hyperlink.add(click1))
  18. text.insert(INSERT, "\n\n")
  19.  
  20. def click2():
  21.     print "click 2"
  22.  
  23. text.insert(INSERT, "this is another ")
  24. text.insert(INSERT, "link", hyperlink.add(click2))
  25. text.insert(INSERT, "\n\n")
  26.  
  27. mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement