fenfire-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ff-cvs] libvob/vob/demo/mouse drags.py


From: Tuomas J. Lukka
Subject: [ff-cvs] libvob/vob/demo/mouse drags.py
Date: Tue, 19 Aug 2003 03:10:45 -0400

CVSROOT:        /cvsroot/libvob
Module name:    libvob
Branch:         
Changes by:     Tuomas J. Lukka <address@hidden>        03/08/19 03:10:45

Modified files:
        vob/demo/mouse : drags.py 

Log message:
        Fix the demo to reuse vs

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/demo/mouse/drags.py.diff?tr1=1.5&tr2=1.6&r1=text&r2=text

Patches:
Index: libvob/vob/demo/mouse/drags.py
diff -u libvob/vob/demo/mouse/drags.py:1.5 libvob/vob/demo/mouse/drags.py:1.6
--- libvob/vob/demo/mouse/drags.py:1.5  Mon Aug 18 16:06:30 2003
+++ libvob/vob/demo/mouse/drags.py      Tue Aug 19 03:10:45 2003
@@ -71,6 +71,7 @@
            x, y, self.scene.places[0][2], self.scene.places[0][3])
        # Note how we don't call update() here: we *don't* want
        # to set the new coordinates.
+       self.scene.updateSlow()
        vob.AbstractUpdateManager.chg()
 
 class QuadSelect(vob.mouse.MousePressListener):
@@ -80,7 +81,6 @@
     def pressed(self, x, y):
        if self.scene.vs == None: return
        key = self.scene.vs.getKeyAt(0, x, y, None)
-       print "Key:",key
        if key == None: return None
        return self.drags[key]
 
@@ -110,23 +110,30 @@
            )
 
     def mouse(self, ev):
-       print ev
        self.multiplexer.deliverEvent(ev)
 
     def scene(self, vs):
-       print "Gen:",self.places
-       #if self.vs != None:
-       #    return self.vs
-       vs.put( background((0.1,0.9,0.8)))
-       cs0 = vs.orthoCS(0, "0", 0, *self.places[0])
-       vs.put(self.quads[0], cs0)
-       cs1 = vs.orthoCS(0, "1", 10, *self.places[1])
-       vs.put(self.quads[1], cs1)
-
-       vs.activate(cs0)
-       vs.activate(cs1)
+       if self.vs != None:
+           return self.vs
        self.vs = vs
+       vs.put( background((0.1,0.9,0.8)))
+       self.cs0 = vs.orthoCS(0, "0", 0, 0,0,1,1)
+       self.cs1 = vs.orthoCS(0, "1", 10, 0,0,1,1)
+       self.updateCoords()
+       vs.put(self.quads[0], self.cs0)
+       vs.put(self.quads[1], self.cs1)
+
+       vs.activate(self.cs0)
+       vs.activate(self.cs1)
+
+    def updateCoords(self):
+       self.vs.coords.setOrthoParams(self.cs0, 0, *self.places[0])
+       self.vs.coords.setOrthoParams(self.cs1, 10, *self.places[1])
 
+    def updateSlow(self):
+       self.vs = None
     def update(self):
+       if self.vs == None: return
+       self.updateCoords()
        vob.AbstractUpdateManager.chg()
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]