13 from stdwinevents
import *
14 from GL
import BLACK
, RED
, GREEN
, YELLOW
, BLUE
, MAGENTA
, CYAN
, WHITE
18 stdwin
.setdefwinsize(300, 300)
19 stdwin
.setdefwinpos(0, 0)
20 if color
: stdwin
.setbgcolor(YELLOW
)
21 w1
= stdwin
.open('Hello, world')
22 w1
.box
= (10, 10), (90, 90)
24 stdwin
.setdefwinsize(0, 0)
25 stdwin
.setdefwinpos(50, 50)
26 if color
: stdwin
.setbgcolor(GREEN
)
27 w2
= stdwin
.open('Second window')
28 w2
.box
= (10, 10), (90, 90)
31 type, window
, detail
= stdwin
.getevent()
33 d
= window
.begindrawing()
35 if color
: d
.setfgcolor(BLACK
)
36 d
.box(((50, 50), (250, 250)))
37 if color
: d
.setfgcolor(RED
)
38 d
.cliprect(((50, 50), (250, 250)))
41 if color
: d
.setfgcolor(BLUE
)
42 d
.line((0, 0), w1
.box
[0])
44 if color
: d
.setfgcolor(WHITE
)
46 if color
: d
.setfgcolor(BLACK
)
47 d
.text(w2
.box
[0], 'Hello world')
49 print 'Strange draw???', window
, detail
51 elif type == WE_CLOSE
:
52 if needclose
: window
.close()
58 print 'weird close event???', window
, detail
59 elif type in (WE_MOUSE_DOWN
, WE_MOUSE_MOVE
, WE_MOUSE_UP
):
61 window
.box
= (h
, v
), (h
+80, v
+80)
62 window
.change(((0,0), (2000, 2000)))
64 print 'character', `detail`
66 print type, window
, detail