Skip to content

Commit 140ab8d

Browse files
committed
Added main menu
1 parent 825a7c3 commit 140ab8d

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

src/com/dtmilano/android/culebron.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
2020
'''
2121

22-
__version__ = '9.2.1'
22+
__version__ = '9.3.0'
2323

2424
import sys
2525
import threading
@@ -28,6 +28,7 @@
2828
import string
2929
import os
3030
import platform
31+
from Tkconstants import DISABLED
3132

3233
try:
3334
from PIL import Image, ImageTk
@@ -153,6 +154,8 @@ def __init__(self, vc, printOperation, scale=1):
153154
self.serialno = vc.serialno
154155
self.scale = scale
155156
self.window = Tkinter.Tk()
157+
self.mainMenu = MainMenu(self)
158+
self.window.config(menu=self.mainMenu)
156159
self.statusBar = StatusBar(self.window)
157160
self.statusBar.pack(side=Tkinter.BOTTOM, padx=2, pady=2, fill=Tkinter.X)
158161
self.statusBar.set("Always press F1 for help")
@@ -941,6 +944,23 @@ def mainloop(self):
941944

942945

943946
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+
944964
class StatusBar(Tkinter.Frame):
945965

946966
def __init__(self, parent):

0 commit comments

Comments
 (0)