Changeset - 0f112a7dd6b3
[Not reviewed]
default
0 4 0
drewp@bigasterisk.com - 20 years ago 2005-06-16 22:33:27
drewp@bigasterisk.com
fix window positoins for subcomposer and curvecalc. now saves geometry continuously
4 files changed with 11 insertions and 8 deletions:
0 comments (0 inline, 0 general)
bin/curvecalc
Show inline comments
 
@@ -18,7 +18,8 @@ from light9 import Submaster, dmxclient,
 
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 @@ def subterm_adder(master, curveset, subt
 
#######################################################################
 
root=tk.Tk()
 
root.tk_setPalette("gray50")
 
root.wm_geometry("1120x850")
 
toplevelat("curvecalc",root)
 
root.tk_focusFollowsMouse()
 

	
 
parser = optparse.OptionParser()
bin/keyboardcomposer
Show inline comments
 
@@ -257,6 +257,7 @@ if __name__ == "__main__":
 

	
 
    root = Tk()
 
    tl = toplevelat("Keyboard Composer", existingtoplevel=root)
 

	
 
    kc = KeyboardComposer(tl, s)
 
    kc.pack(fill=BOTH, expand=1)
 

	
 
@@ -266,5 +267,7 @@ if __name__ == "__main__":
 
    root.bind("<Destroy>",reactor.stop)
 
    root.protocol('WM_DELETE_WINDOW', reactor.stop)
 
    reactor.addSystemEventTrigger('after','shutdown',kc.save)
 

	
 
    
 
    tksupport.install(root,ms=10)
 
    reactor.run()
light9/curve.py
Show inline comments
 
@@ -81,6 +81,8 @@ class Curveview(tk.Canvas):
 
        self.bind("<Key-Escape>",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 @@ class Curveview(tk.Canvas):
 
        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()
light9/uihelpers.py
Show inline comments
 
@@ -33,14 +33,10 @@ def toplevel_savegeometry(tl,name):
 
            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("<Destroy>",tl._toplevelat_funcid)
 

	
 
def toplevelat(name, existingtoplevel=None):
 
    tl = existingtoplevel or Toplevel()
 
    tl.title(name)
 
@@ -55,7 +51,7 @@ def toplevelat(name, existingtoplevel=No
 
    if name in windowlocations:
 
        tl.geometry(windowlocations[name])
 

	
 
    tl._toplevelat_funcid=tl.bind("<Destroy>",lambda ev,tl=tl,name=name: toplevel_savegeometry(tl,name))
 
    tl._toplevelat_funcid = tl.bind("<Configure>",lambda ev,tl=tl,name=name: toplevel_savegeometry(tl,name))
 

	
 
    return tl
 

	
0 comments (0 inline, 0 general)