rem ' dialog.txt sysgui = unt open (sysgui)"X0" print (sysgui)'context'(1) print (sysgui)'window'(200,200,200,100,"Dialog",$000f0010$,$00800004$) print (sysgui)'edit'(101,10,10,100,30,"Dialog",$$) print (sysgui)'button'(2,10,50,100,30,"Hide Dialog",$$) print (sysgui)'context'(0) print (sysgui)'window'(100,100,200,200,"Window",$00010003$,$00800004$) print (sysgui)'edit'(101,10,10,100,30,"Window",$$) print (sysgui)'checkbox'(102,120,10,70,30,"Flush",$$) print (sysgui)'button'(1,10,50,100,30,"Show Dialog",$$) dim event$:tmpl(sysgui) count = 0 repeat readrecord(sysgui,siz=10)event$ count = count + 1 print event.code$,event.context,event.id,event.flags,event.x,event.y,count if event.code$="B" and event.id=1 then gosub show if event.code$="B" and event.id=2 then gosub hide if event.code$="X" and event.context=1 then gosub oops until event.code$="X" and event.context=0 release show: print (sysgui)'focus'(101) print (sysgui)'title'(101,ctrl(sysgui,101,1)) print (sysgui)'context'(1),'show'(0),'focus'(2) if dec(ctrl(sysgui,102,2,0)) then print (sysgui)'flush' return hide: print (sysgui)'context'(1),'hide'(0),'context'(0),'focus'(1) if dec(ctrl(sysgui,102,2,0)) then print (sysgui)'flush' return oops: i=msgbox("Dialog window fired a close (X) event",48,"Dialog") return