diff bin/curvecalc @ 279:5bfcf309e1ad

Submaster objects listen for a signal to reload, curvecalc can broadcast it Also, an easter egg change: "Something I shoulda done a long time ago!"
author David McClosky <dmcc@bigasterisk.com>
date Fri, 17 Jun 2005 19:57:29 +0000
parents e7630a2072bd
children 6cde24055a67
line wrap: on
line diff
--- a/bin/curvecalc	Fri Jun 17 18:23:53 2005 +0000
+++ b/bin/curvecalc	Fri Jun 17 19:57:29 2005 +0000
@@ -218,13 +218,17 @@
 
     return term
 
-def subterm_adder(master, curveset, subterms, root, ssv):
+def sub_commands_tk(master, curveset, subterms, root, ssv):
     f=tk.Frame(master,relief='raised',bd=1)
     newname = tk.StringVar()
 
     def add_cmd():
         add_one_subterm(newname.get(), curveset, subterms, root, ssv, '')
 
+    def reload_subs():
+        dispatcher.send('reload all subs')
+
+    tk.Button(f, text="reload subs", command=reload_subs).pack(side='left')
     tk.Button(f,text="new subterm named:", command=add_cmd).pack(side='left')
     tk.Entry(f,textvariable=newname).pack(side='left',fill='x',exp=1)
     return f
@@ -256,7 +260,7 @@
 ssv = SubtermSetView(root)
 ssv.pack(side='top', fill='x')
 
-root.title("Curemaster 2000MX - %s" % song)
+root.title("Curvemaster 3000MX - %s" % song)
 
 musicfilename = showconfig.songFilename(song)
 maxtime = wavelength(musicfilename)
@@ -265,7 +269,8 @@
 curveset.load(basename=os.path.join(showconfig.curvesDir(),song))
 
 subterms = []
-subterm_adder(root, curveset, subterms, root, ssv).pack(side='top',fill='x')
+sub_commands_tk(root, curveset, subterms, root, ssv).pack(side='top',fill='x')
+
 for line in file(showconfig.subtermsForSong(song)):
     try:
         subname,expr = line.strip().split(" ",1)
@@ -285,7 +290,6 @@
     savesubterms(showconfig.subtermsForSong(song),subterms)
     curveset.save(basename=os.path.join(showconfig.curvesDir(),song))
     print "saved"
-
     
 root.bind("<Control-Key-s>",savekey)