home *** CD-ROM | disk | FTP | other *** search
-
- /* Sample ARexx User-defined requester */
-
- if ~show('l', "rexxsupport.library") then
- addlib('rexxsupport.library',0,-30,0)
-
- options results
-
- portname = 'MYPORT'
- shutdown = 0
- if openport(portname) then do
-
- window allocate /* request a new window object */
- win = result /* store window object # in 'win' */
- window win gadget 1 10 165 100 0 ok 0 "Use" "use"
- window win gadget 0 126 165 100 0 reset 0 "Reset" "reset"
- window win gadget 0 242 165 100 0 cancel 0 "Cancel" "cancel"
-
- window win open 365 200 '"Test Requester..."' async portname notify reset
- woi = result
- if woi ~= null() then do
-
- woi mode jam1
- woi pen 1
- woi line 10 20 100 20
- woi pen 2
- woi draw 30 30
- woi box 10 100 200 150
- woi mode complement
- woi rect 100 50 300 120
-
- do until shutdown
-
- call waitpkt(portname)
- msg = getpkt(portname)
-
- if msg ~= '0000 0000'x then do
- cmd = getarg(msg)
-
- if upper(cmd)='USE' then
- shutdown = 1
-
- if upper(cmd)='CANCEL' then
- shutdown = 1
-
- call reply(msg,0)
- end
- end
- end
- call closeport(portname)
- window win free /* free all window resources */
- end
-