Last active
December 23, 2015 04:59
-
-
Save rhoit/6583664 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python3 | |
| # this code works has been corrected as suggested by Bhaskar Chaudhary <bha100710@gmail.com> | |
| from tkinter import * | |
| from tkinter import ttk | |
| if __name__ == '__main__': | |
| root=Tk() | |
| nb = ttk.Notebook() | |
| nb.pack(expand=YES, fill=BOTH ) | |
| f1=Frame(width=200, height=200, bg="red") | |
| f2=Frame(width=200, height=200, bg="blue") | |
| f3=Frame(width=200, height=200, bg="green") | |
| nb.add(f1, text="red", padding=3) | |
| nb.add(f2, text="blue", padding=3) | |
| nb.add(f3, text="green", padding=3) | |
| tablst=nb.tabs() | |
| root.bind('<Alt-KeyPress-1>', lambda event: nb.select(tablst[0])) | |
| root.bind('<Alt-KeyPress-2>', lambda event: nb.select(tablst[1])) | |
| root.bind('<Alt-KeyPress-3>', lambda event: nb.select(tablst[2])) | |
| root.bind('<Key-Escape>', lambda event: quit()) | |
| root.mainloop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment