Advertisement
deadmarshal

Clickable listview!

Jun 16th, 2015
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. import tkinter as tk
  2.  
  3. words = ['a','list','of','strings']
  4.  
  5. def search():
  6.      target = eSearch.get()
  7.      if target in words:
  8.         tList.delete(0.0,tk.END)
  9.         tList.insert(0.0,target)
  10.  
  11. top = tk.Tk()
  12.  
  13. eSearch = tk.Entry(top)
  14. eSearch.pack()
  15. tList = tk.Text()
  16. tList.insert(0.0, '\n'.join(words))
  17. tList.pack()
  18. bSearch = tk.Button(top, text='Search', command=search)
  19. bSearch.pack()
  20.  
  21. top.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement