LIBRARY rexxgui, rxclip, rxconsole
cliperr = "SYNTAX"
clipheading = 1
guierr = "SYNTAX"
guiheading = 1
guicreatewindow('NORMAL')
guigetctlplacement(, , , "Width", "Height")
concreate(, guiwindow, "CHILD", 0, 60, width, height - 60)
myformat = clipnewformat('MY_FORMAT')
datacopied = 1
windowhandle = guiinfo("HANDLE", guiwindow)
nextwindow = clipinform(windowhandle)
again:
DO FOREVER
guigetmsg()
CATCH SYNTAX
CONDITION()
SIGNAL again
CATCH HALT
FINALLY
guidestroywindow()
END
RETURN
wm_drawclipboard:
DO
IF datacopied \== 1 THEN DO
IF clipavailable(myformat) THEN DO
clipget("MyVar.", myformat)
DO i = 1 TO myvar.0
SAY myvar.i
END
END
END
FINALLY
datacopied = 0
clipinformend(nextwindow)
END
RETURN ""
wm_click_text1:
datacopied = 1
myvar.1 = "Text 1"
DROP myvar.2
clipset("MyVar.", myformat)
RETURN
wm_click_text2:
datacopied = 1
myvar.1 = "Text 2"
DROP myvar.2
clipset("MyVar.", myformat)
RETURN |