Posted to tcl by aspect at Wed Apr 13 01:56:26 GMT 2016view raw

  1. from Tkinter import *
  2. from ttk import *
  3.  
  4. root = Tk()
  5. e = Entry(root, text = "Type in here")
  6. n = Notebook(root)
  7.  
  8. n.add(Text(n), text = "Tab 1")
  9. n.add(Text(n), text = "Tab 2")
  10. n.add(Text(n), text = "Tab 3")
  11.  
  12. e.pack()
  13. n.pack()
  14.  
  15. e.bind('<Key-1>', lambda _: n.select(0))
  16. e.bind('<Key-2>', lambda _: n.select(1))
  17. e.bind('<Key-3>', lambda _: n.select(2))
  18.  
  19.  
  20. root.mainloop()
  21.