1 /* REXX test script for rexxbgui.library */
3 if ~show
('l','rexxbgui.library') then do
4 if ~addlib
('rexxbgui.library',0,-30) then do
11 call bguiopen
() /* causes error 12 if it did not work */
12 /* supply a second argument for a '0' return code instead of an ARexx
15 signal on syntax /* important: bguiclose() MUST be called */
26 /* using ARexx feature: ,<newline> is translated to nothing */
27 /* the || are essential - any added space will cause trouble */
28 /* redefining the same ID makes previous buttons unaccessible */
29 /* do not redefine winclose etc. */
32 bguistring
('str1','String #_1','max 10',10)||,
33 bguistring
('str2','String #_2','Not in tabcycle chain.',30)||,
34 bguistring
('str3','String #_3','text',30)||,
35 bguiinteger
('int1','_Integer')||,
36 bguiinfo
('inf1','Info',esc
's'esc
'd3'||'Enter something in string #2!')||,
38 bguitoggle
('toggle','_Disable checkbox')||,
40 bguicheckbox
('check','Dis_able OK button'),
41 ,grspace
.normal
,'FRAME','Two notifying gadgets')||,
43 bguibutton
('show','_Show values')||,
45 bguibutton
('ok',esc
'b'||'OK_'cr
),
47 ,grspace
.normal
,grspace
.normal
)
49 a
=bguiwindow
('BGUI from ARexx!',g
,50,'-0',,arg(1))
51 call bguiwintabcycleorder
(a
,obj
.str1
||obj
.str3
||obj
.int1
)
52 call bguiaddmap
(obj
.str2
,obj
.inf1
,STRINGA_TextVal
,INFO_TextFormat
)
53 call bguiaddmap
(obj
.toggle
,obj
.check
,GA_Selected
,GA_Disabled
)
54 call bguiaddmap
(obj
.check
,obj
.ok
,GA_Selected
,GA_Disabled
)
56 if bguiwinopen
(a
)=0 then bguierror
(12)
58 do while bguiwinwaitevent
(a
,'ID')~
=id
.winclose
60 when id
=id
.winactive
then nop
61 when id
=id
.wininactive
then nop
62 when id
=id
.show
then do
63 text
=bguiget
(obj
.str1
,STRINGA_TextVal
)lf
||,
64 bguiget
(obj
.str2
,STRINGA_TextVal
)lf
||,
65 bguiget
(obj
.str3
,STRINGA_TextVal
)lf
||,
66 bguiget
(obj
.int1
,STRINGA_LongVal
)
67 call bguireq
('Results are:'lf
||text
,'*_OK',,a
)
69 when id
=id
.ok
then leave
70 when id
=id
.winclose
then nop
71 when id
=id
.winnomore
then call bguiwait
() /* to test bguiwinevent() */
78 if rc~
=0 then say '+++ ['rc']' errortext(rc) 'at line' sigl
85 say '+++ Break at line' sigl