sysgui = unt open (sysgui)"X0" if pos(" 5 "=sys) then image$="cat.bmp" else image$="cat.png" width = 466 height = 312 print (sysgui)'window'(100,100,992,684,"Images",$00010003$,$ffffffff$) print (sysgui)'tbutton'(101,20,20,width,height,"BITMAP="+image$,$$),'cue'(101,"TBUTTON","TBUTTON") print (sysgui)'button'(102,506,20,width,height,"BITMAP="+image$,$$),'cue'(102,"BUTTON","BUTTON") print (sysgui)'tbutton'(103,20,352,width,height,"BITMAP="+image$,$0400$),'cue'(101,"TBUTTON","TBUTTON") print (sysgui,err=skip)'menubutton'(104,506,352,width,height,"BITMAP="+image$,$$),'cue'(104,"MENUBUTTON","MENUBUTTON") skip: dim event$:tmpl(sysgui),info$:"x:i(2),y:i(2),w:i(2),h:i(2)" eventloop: repeat read record(sysgui,siz=10)event$ print event.code$,event.id,event.flags,event.x,event.y if event.code$="b" or event.code$="B" then gosub click until event.code$="X" release click: info$ = ctrl(sysgui,event.id,0,event.context) w = int(info.w * 0.90) h = int(info.h * 0.90) x = info.x + int((info.w - w) / 2) y = info.y + int((info.h - h) / 2) print (sysgui)'move'(event.id,x,y),'size'(event.id,w,h) print (sysgui)'cue'(event.id,"width="+str(w)+" height="+str(h),$$) return