# HG changeset patch # User Drew Perttula # Date 1308292428 0 # Node ID 7ee76a895427216ef21f4fe1a8ff134f3e894717 # Parent 8c878eb4e214e4464106ceaea92396013dc33682 start CC menubar Ignore-this: ecd7bf129c2ee9c03bfc1a67f3232d45 diff -r 8c878eb4e214 -r 7ee76a895427 bin/curvecalc --- 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("",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)