3 ; move-resize-demo.lsp - demonstrate gs:window-moved and hs:window-resized events
6 (load (append (env "NEWLISPDIR") "/guiserver.lsp"))
12 (gs:frame
'EventDemo
100 100 300 100 "Move or resize window")
13 (gs:set-border-layout
'EventDemo
)
14 (gs:label
'Position
"")
16 (gs:set-font
'Position
"Mono Spaced" 24 "bold")
17 (gs:set-foreground
'Position
0 0 0.5 )
18 (gs:set-font
'Size
"Mono Spaced" 24 "bold")
19 (gs:set-foreground
'Size
0 0 0.5 )
21 (gs:add-to
'EventDemo
'Position
"north")
22 (gs:add-to
'EventDemo
'Size
"south")
24 (gs:window-moved
'EventDemo
'move-action
)
25 (gs:window-resized
'EventDemo
'resize-action
)
29 (define (move-action id x y
)
30 (gs:set-text
'Position
(string "Position " x
":" y
)))
32 (define (resize-action id width height
)
33 (gs:set-text
'Size
(string "Size " width
":" height
)))
36 (gs:set-visible
'EventDemo true
)
38 ;;;; listen for incoming action requests and dispatch