changeset 639:7ee76a895427

start CC menubar Ignore-this: ecd7bf129c2ee9c03bfc1a67f3232d45
author Drew Perttula <drewp@bigasterisk.com>
date Fri, 17 Jun 2011 06:33:48 +0000
parents 8c878eb4e214
children 2d058d0bc1ea
files bin/curvecalc
diffstat 1 files changed, 21 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/bin/curvecalc	Thu Jun 16 07:11:58 2011 +0000
+++ b/bin/curvecalc	Fri Jun 17 06:33:48 2011 +0000
@@ -453,6 +453,22 @@
     root.bind("<Destroy>",lambda ev: reactor.stop)
     root.protocol('WM_DELETE_WINDOW', reactor.stop)
 
+def setupMenubar(barFrame, root):
+    class newMenu(object):
+        def __init__(self, name):
+            self.name = name
+        def __enter__(self):
+            m = tk.Menubutton(barFrame, text=self.name)
+            m.pack(side='left')
+            mm = tk.Menu(m)
+            m.config(menu=mm)
+            return mm
+        def __exit__(self, type, value, traceback):
+            return False
+        
+    with newMenu("Curvecalc") as mm:
+        mm.add_command(label='Quit', command=root.destroy)
+
 def createHelpLines(root):
     for helpline in ["Bindings: C-s save subterms;  Esc see current time; S-Esc see curtime to end; C-Esc show all; Mousewheel zoom; C-p play/pause music at mouse",
                      "Curve point bindings: B1 drag point; C-B1 curve add point; S-B1 sketch points; Del selected points; 1..5 add point at time; B1 drag select points",
@@ -512,7 +528,11 @@
     root.tk_setPalette("gray50")
     toplevelat("curvecalc",root)
     root.tk_focusFollowsMouse()
-    root.title("Was Curvemaster 3000MX. Now Curvemaster 30002MX! - %s" % graph.label(song))
+    root.title("curvecalc - %s" % graph.label(song))
+
+    menubar = tk.Frame(root)
+    menubar.pack(side='top', fill='x')
+    setupMenubar(menubar, root)
 
     if 'fixed top rows':
         zc = Zoomcontrol(root)