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 */
25 /* using ARexx feature: ,<newline> is translated to nothing */
26 /* the || are essential - any added space will cause trouble */
27 /* redefining the same ID makes previous buttons unaccessible */
28 /* do not redefine winclose etc. */
29 /* note the bold button: <return> is the shortcut key */
32 bguibutton
('but1',esc
's'esc
'd3'||'_Change text')||,
33 bguibutton
('but2',esc
'i'||'Disable')||,
35 bguibutton
('but3','AAA')||,
36 bguibutton
('but4',esc
'u'||'_Enable'),
38 bguibutton
('but5','A_AA')||,
39 bguibutton
('but6',esc
'b'||esc
'k'||'<RETURN> as'lf
'shortcut_'||'0d'x
),
41 inf
=bguiinfo
('info','Info','Using BGUI from ARexx'lf
'via',
43 b
=bguibutton
('butrq','Show _BGUI_RequestA')||bguibutton
('quit','_Quit')
44 g
=bguivgroup
(inf
||bla
||b
,grspace
.normal
,grspace
.normal
)
45 a
=bguiwindow
('BGUI from ARexx!',g
,50,'-0',,arg(1))
46 if bguiwinopen
(a
)=0 then bguierror
(12)
48 do while bguiwinwaitevent
(a
,'ID')~
=id
.winclose
50 when id
=id
.winactive
then nop
51 when id
=id
.wininactive
then nop
52 when id
=id
.butrq
then call bguireq
('Button pressed!','*_OK',,a
)
53 when id
=id
.but1
then call bguiset
(obj
.info
,a
,INFO_TextFormat
,esc
||'c%%% percent sign%s!')
54 when id
=id
.but2
then call bguiset
(obj
.but3
,a
,GA_Disabled
,1)
55 when id
=id
.but4
then call bguiset
(obj
.but3
,a
,GA_Disabled
,0)
56 when id
=id
.quit
then leave
57 when id
=id
.winclose
then nop
58 when id
=id
.winnomore
then call bguiwait
() /* to test bguiwinevent() */
65 if rc~
=0 then say '+++ ['rc']' errortext(rc) 'at line' sigl
72 say '+++ Break at line' sigl