# HG changeset patch # User drewp@bigasterisk.com # Date 1118961207 0 # Node ID 0f112a7dd6b3d9adfbd74a74ffa08db39c5b95d4 # Parent 5da9139982c03704bef67b449bf4db022352745e fix window positoins for subcomposer and curvecalc. now saves geometry continuously diff -r 5da9139982c0 -r 0f112a7dd6b3 bin/curvecalc --- a/bin/curvecalc Thu Jun 16 22:32:29 2005 +0000 +++ b/bin/curvecalc Thu Jun 16 22:33:27 2005 +0000 @@ -18,7 +18,8 @@ from light9.TLUtility import make_attributes_from_args from light9.zoomcontrol import Zoomcontrol from light9.curve import Curve, Curveview, Curveset, Curvesetview -from light9.wavelength import wavelength +from light9.wavelength import wavelength +from light9.uihelpers import toplevelat class Music: def __init__(self): @@ -222,7 +223,7 @@ ####################################################################### root=tk.Tk() root.tk_setPalette("gray50") -root.wm_geometry("1120x850") +toplevelat("curvecalc",root) root.tk_focusFollowsMouse() parser = optparse.OptionParser() diff -r 5da9139982c0 -r 0f112a7dd6b3 bin/keyboardcomposer --- a/bin/keyboardcomposer Thu Jun 16 22:32:29 2005 +0000 +++ b/bin/keyboardcomposer Thu Jun 16 22:33:27 2005 +0000 @@ -257,6 +257,7 @@ root = Tk() tl = toplevelat("Keyboard Composer", existingtoplevel=root) + kc = KeyboardComposer(tl, s) kc.pack(fill=BOTH, expand=1) @@ -266,5 +267,7 @@ root.bind("",reactor.stop) root.protocol('WM_DELETE_WINDOW', reactor.stop) reactor.addSystemEventTrigger('after','shutdown',kc.save) + + tksupport.install(root,ms=10) reactor.run() diff -r 5da9139982c0 -r 0f112a7dd6b3 light9/curve.py --- a/light9/curve.py Thu Jun 16 22:32:29 2005 +0000 +++ b/light9/curve.py Thu Jun 16 22:33:27 2005 +0000 @@ -81,6 +81,8 @@ self.bind("",lambda ev: dispatcher.send("see time", t=self.current_time())) + + # this binds on c-a-b1, etc RegionZoom(self, self.world_from_screen, self.screen_from_world) def current_time(self): @@ -90,6 +92,7 @@ start,end = self.zoom ht = self.winfo_height() return (p[0]-start)/(end-start)*self.winfo_width(), (ht-5)-p[1]*(ht-10) + def world_from_screen(self,x,y): start,end = self.zoom ht = self.winfo_height() diff -r 5da9139982c0 -r 0f112a7dd6b3 light9/uihelpers.py --- a/light9/uihelpers.py Thu Jun 16 22:32:29 2005 +0000 +++ b/light9/uihelpers.py Thu Jun 16 22:33:27 2005 +0000 @@ -33,14 +33,10 @@ f=open(".light9-window-geometry-%s" % name.replace(' ','_'),'w') f.write(tl.geometry()) # else the window never got mapped - except: + except Exception, e: # it's ok if there's no saved geometry pass - # this would get called repeatedly for each child of the window (i - # dont know why) so we unbind after the first Destroy event - tl.unbind("",tl._toplevelat_funcid) - def toplevelat(name, existingtoplevel=None): tl = existingtoplevel or Toplevel() tl.title(name) @@ -55,7 +51,7 @@ if name in windowlocations: tl.geometry(windowlocations[name]) - tl._toplevelat_funcid=tl.bind("",lambda ev,tl=tl,name=name: toplevel_savegeometry(tl,name)) + tl._toplevelat_funcid = tl.bind("",lambda ev,tl=tl,name=name: toplevel_savegeometry(tl,name)) return tl