/[libvob]/libvob/vob/demo/input/bars.py
ViewVC logotype

Diff of /libvob/vob/demo/input/bars.py

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

revision 1.2 by tjl, Mon Jun 30 07:47:16 2003 UTC revision 1.3 by tjl, Mon Jun 30 07:54:08 2003 UTC
# Line 8  class Scene: Line 8  class Scene:
8      def __init__(self):      def __init__(self):
9          self.ps2 = vob.input.impl.PS2MouseDevice("/dev/input/mouse1", "main",          self.ps2 = vob.input.impl.PS2MouseDevice("/dev/input/mouse1", "main",
10                          vob.input.impl.PS2MouseDevice.IMPS_PROTO)                          vob.input.impl.PS2MouseDevice.IMPS_PROTO)
11            self.naxes = len(self.ps2.getAxes())
12          self.axes = [          self.axes = [
13              vob.input.impl.StandardBoundedFloatModel(0, 400,              vob.input.impl.StandardBoundedFloatModel(0, 400,
14                  actionPerformed = lambda x: vob.AbstractUpdateManager.chg())                  actionPerformed = lambda x: vob.AbstractUpdateManager.chg())
15              for i in range(0,2)]              for i in range(0,self.naxes)]
16          for i in range(0,2):          for i in range(0,self.naxes):
17              self.ps2.getAxes()[i].setMainListener(              self.ps2.getAxes()[i].setMainListener(
18                  vob.input.BoundedFloatLinearAbsoluteAdapter(self.axes[i]))                  vob.input.BoundedFloatLinearAbsoluteAdapter(self.axes[i]))
19      def scene(self, vs):      def scene(self, vs):
20          vs.put( background((0.1,0.3,0.9)))          vs.put( background((0.1,0.3,0.9)))
21          print "SC"          #print "SC"
22          for i in range(0,2):          #for i in range(0,self.naxes):
23              print self.axes[i].getValue()          #    print self.axes[i].getValue()
24    
25            for i in range(0,self.naxes):
26                vs.put(coloredQuad((1,1,1)),
27                  vs.orthoCS(0, i, 0, 60 + i * 60, 700, 40,
28                    - self.axes[i].getValue()))
29    
30    
31    

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

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