Initial commit of newLISP.
[newlisp.git] / guiserver / properties-demo.lsp
blob904f2060fbe9849672b0f3816fe07fe52ee1209a
1 #!/usr/bin/newlisp
2 ;;
3 ;; property-demo.lsp - demonstrate gs:get-screen and gs:get-version
5 ;;;; initialization
6 (set-locale "C")
7 (load (append (env "NEWLISPDIR") "/guiserver.lsp"))
9 (gs:init)
10 ;;;; describe the GUI
12 (gs:get-screen)
13 (set 'x (/ (- (gs:screen 0) 450) 2))
14 (set 'y (/ (- (gs:screen 1) 400) 2))
16 (gs:frame 'PropertyDemo x y 450 400 "Properties")
17 (gs:text-area 'Output 'gs:no-action')
18 (gs:set-editable 'Output nil)
19 (gs:add-to 'PropertyDemo 'Output)
20 (gs:set-visible 'PropertyDemo true)
22 (gs:set-text 'Output (join (map string (gs:get-fonts)) "\n"))
23 (gs:set-text 'PropertyDemo
24 (string "GUI-server v." (gs:get-version)
25 " screen: " (gs:screen 0) "x" (gs:screen 1)
26 ", " (gs:screen 2) " dots/inch"))
28 ;;;; listen for incoming action requests and dispatch
30 (gs:listen)
32 ;; eof