1 from joy import *
2
4 """HelloJoyApp
5
6 The "hello world" of JoyApp programming.
7 This JoyApp pipes the y coordinate of mouse positions (while left
8 button is pressed) to a specified setter. By default this setter is
9 given by "#output " -- i.e. it is a debug message.
10
11 See JoyApp.setterOf() for a specification of possible outputs
12 """
14
15
16
17
18 JoyApp.__init__(self, *arg,**kw)
19
20 self.spec = spec
21
23
24
25
26 self.output = self.setterOf(self.spec)
27
29
30 if evt.type != MOUSEMOTION or evt.buttons[0] == 0:
31 return JoyApp.onEvent(self,evt)
32
33
34 self.output( evt.pos[1] )
35 if __name__=="__main__":
36 app = HelloJoyApp("#output ")
37 app.run()
38