/[gzz]/gzz/gfx/demo/keymap-test.py
ViewVC logotype

Diff of /gzz/gfx/demo/keymap-test.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by mudyc, Tue Jan 7 12:25:07 2003 UTC revision 1.2 by tjl, Tue Jan 7 12:36:57 2003 UTC
# Line 11  class ViewScene: Line 11  class ViewScene:
11          # BackGround          # BackGround
12          self.bgcolor = (0.5, 0.4, 0.7)          self.bgcolor = (0.5, 0.4, 0.7)
13          putnoc(vs, background(self.bgcolor))          putnoc(vs, background(self.bgcolor))
         cs2 = vs.coords.affineCoordsys(0, 0, 0, 0, 0.1, 0, 0, 0.1)  
14    
15          # Put a Text Vob          # Put a Text Vob
16          colchars = 60          colchars = 60
# Line 21  class ViewScene: Line 20  class ViewScene:
20          vs.matcher.add(cs1, "1")          vs.matcher.add(cs1, "1")
21          putText(vs, cs1, 'Text Vob', color=(0,0,0), h=4, y = 3)          putText(vs, cs1, 'Text Vob', color=(0,0,0), h=4, y = 3)
22    
23          self.vs = vs          # Note how we map the OLD cs2 to the NEW cs1
24          self.cs = cs1          if hasattr(self,"cs2"):
25                vs.matcher.keymapSingleCoordsys(cs1, self.cs2)
26    
27            # and now store the NEW cs2
28            self.cs2 = vs.translateCS(0, "X", 150,150,0)
29    
30    
31      def key(self, k):      def key(self, k):
32          print 'simsalapim!'          print 'simsalapim!'
         cs2 = self.vs.translateCS(0, "X", 150,150,0)  
         self.vs.matcher.keymapSingleCoordsys(self.cs, cs2)  
33          self.a = self.a + 5          self.a = self.a + 5
34    
35  currentScene = ViewScene()  currentScene = ViewScene()

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26