|
19 | 19 |
|
20 | 20 | ''' |
21 | 21 |
|
22 | | -__version__ = '9.2.1' |
| 22 | +__version__ = '9.3.0' |
23 | 23 |
|
24 | 24 | import sys |
25 | 25 | import threading |
|
28 | 28 | import string |
29 | 29 | import os |
30 | 30 | import platform |
| 31 | +from Tkconstants import DISABLED |
31 | 32 |
|
32 | 33 | try: |
33 | 34 | from PIL import Image, ImageTk |
@@ -153,6 +154,8 @@ def __init__(self, vc, printOperation, scale=1): |
153 | 154 | self.serialno = vc.serialno |
154 | 155 | self.scale = scale |
155 | 156 | self.window = Tkinter.Tk() |
| 157 | + self.mainMenu = MainMenu(self) |
| 158 | + self.window.config(menu=self.mainMenu) |
156 | 159 | self.statusBar = StatusBar(self.window) |
157 | 160 | self.statusBar.pack(side=Tkinter.BOTTOM, padx=2, pady=2, fill=Tkinter.X) |
158 | 161 | self.statusBar.set("Always press F1 for help") |
@@ -941,6 +944,23 @@ def mainloop(self): |
941 | 944 |
|
942 | 945 |
|
943 | 946 | if TKINTER_AVAILABLE: |
| 947 | + class MainMenu(Tkinter.Menu): |
| 948 | + def __init__(self, culebron): |
| 949 | + Tkinter.Menu.__init__(self, culebron.window) |
| 950 | + self.culebron = culebron |
| 951 | + self.fileMenu = Tkinter.Menu(self) |
| 952 | + self.fileMenu.add_command(label="Quit", underline=0, accelerator='Command-Q', command=self.culebron.quit) |
| 953 | + self.add_cascade(label="File", underline=0, menu=self.fileMenu) |
| 954 | + self.viewMenu = Tkinter.Menu(self) |
| 955 | + self.showTree = Tkinter.BooleanVar() |
| 956 | + self.viewMenu.add_checkbutton(label="Tree", underline=0, accelerator='Command-T', onvalue=True, offvalue=False, variable=self.showTree, state=DISABLED) |
| 957 | + self.showViewDetails = Tkinter.BooleanVar() |
| 958 | + self.viewMenu.add_checkbutton(label="View details", underline=0, accelerator='Command-V', onvalue=True, offvalue=False, variable=self.showViewDetails, state=DISABLED) |
| 959 | + self.add_cascade(label="View", underline=0, menu=self.viewMenu) |
| 960 | + |
| 961 | + def callback(self): |
| 962 | + pass |
| 963 | + |
944 | 964 | class StatusBar(Tkinter.Frame): |
945 | 965 |
|
946 | 966 | def __init__(self, parent): |
|
0 commit comments