3 ; button-demo.lsp - demonstrate the button control
7 (load (append (env "NEWLISPDIR") "/guiserver.lsp"))
12 (constant (global 'home-dir
) (or (env "HOME") (env "USERPROFILE") (env "DOCUMENT_ROOT") ""))
15 (gs:frame
'SoundDemo
100 100 200 100 "Sound Demo")
16 (gs:set-flow-layout
'SoundDemo
"center" 20 20)
17 (gs:button
'aSound
'button-action
"Choose Sound File")
18 (gs:add-to
'SoundDemo
'aSound
)
19 (gs:set-visible
'SoundDemo true
)
22 (define (button-action)
23 (gs:open-file-dialog
'SoundDemo
'openfile-action home-dir
24 ".aif .wav" "Sound files .wav and .aif")
27 (define (openfile-action id op file
)
28 (if file
(gs:play-sound
(base64-dec file
)))
31 ;;;; listen for incoming action requests and dispatch