Open Object REXX on Windows contains OODialog class library for creating GUIs. It requires OOP and seems to be suitable for creating challenging GUIs
- see the examples in your \ooRexx\samples\oodialog subdirectory
There are other GUI libraries available too - I personally want try
REXX/Tk, but the last build is form 2002. Is it still supported or not?
And there are surely other options for GUI libraries, I don't know.
But on Windows there is other way I know - IMHO simpler:
ooRexx could be integrated into WSH (Windows Script Host), so you can use all GUI functions supported by windows native script languages: VBscript and Jscript.
This could be adequate for simple dialogs.
And you can script webpages with ooREXX too - at similar way as you do that with Jscript or VBscript.
Consider, I have a simple REXX program which only uses
say for writing output and
parse pull for reading input:
Hello_Rexx.rex
Code:
[COLOR=#0000ff]/* Main program */[/color]
[COLOR=#804040][b]say[/b][/color] [COLOR=#ff00ff]"Enter your name: "[/color]
[COLOR=#804040][b]parse pull[/b][/color] name
[COLOR=#804040][b]if[/b][/color] name [COLOR=#804040][b]\=[/b][/color] [COLOR=#ff00ff]""[/color][COLOR=#804040][b] then[/b][/color]
[COLOR=#804040][b]say[/b][/color] [COLOR=#ff00ff]"Hello '"[/color][COLOR=#804040][b]||[/b][/color]name[COLOR=#804040][b]||[/b][/color][COLOR=#ff00ff]"' from REXX :-)"[/color]
[COLOR=#804040][b]else[/b][/color]
[COLOR=#804040][b]say[/b][/color] [COLOR=#ff00ff]"Warning: Nothing given!"[/color]
[COLOR=#804040][b]exit[/b][/color]
The program does the following:
Code:
c:\Users\Roman\Work>Hello_Rexx.rex
Enter your name:
mikrom
Hello 'mikrom' from REXX :-)
c:\Users\Roman\Work>Hello_Rexx.rex
Enter your name:
Warning: Nothing given!
Now I want to create a GUI using VBscript functions
msgbox() and
inputbox().
Therefore I create a WSH script. In the WSH script I can combine several languages together (wich are supported by WSH) - it means for example, that I can write some temporary functions in VBscript (or Jscript, Python, Perl,...) and write the main program logic in REXX.
So, first I create a VBscript functions
input_box() and
msg_box(), which are only wrappers for native WSH or VBscript functions
inputbox() and
msgbox().
And then I use simply these VB-functions in my main program written in REXX, without need to rewrite the REXX logic into OOP classes..etc.
Hello_Rexx.wsf
Code:
[COLOR=#008080]<[/color][COLOR=#008080]job[/color][COLOR=#008080] [/color][COLOR=#2e8b57][b]id[/b][/color]=[COLOR=#ff00ff]"REXX_in_WSH"[/color][COLOR=#008080]>[/color]
[COLOR=#008080]<script language="VBScript">[/color]
[COLOR=#804040][b]function[/b][/color] input_box [COLOR=#804040][b]([/b][/color]prompt[COLOR=#804040][b],[/b][/color] title[COLOR=#804040][b])[/b][/color]
input_box [COLOR=#804040][b]=[/b][/color] [COLOR=#008080]inputbox[/color][COLOR=#804040][b]([/b][/color]prompt[COLOR=#804040][b],[/b][/color] title[COLOR=#804040][b])[/b][/color]
[COLOR=#804040][b]end[/b][/color] [COLOR=#804040][b]function[/b][/color]
[COLOR=#804040][b]function[/b][/color] msg_box[COLOR=#804040][b]([/b][/color]prompt[COLOR=#804040][b],[/b][/color] buttons[COLOR=#804040][b],[/b][/color] title[COLOR=#804040][b])[/b][/color]
msg_box [COLOR=#804040][b]=[/b][/color] [COLOR=#008080]msgbox[/color] [COLOR=#804040][b]([/b][/color]prompt[COLOR=#804040][b],[/b][/color] buttons[COLOR=#804040][b],[/b][/color] title[COLOR=#804040][b])[/b][/color]
[COLOR=#804040][b]end[/b][/color] [COLOR=#804040][b]function[/b][/color]
[COLOR=#008080]</script>[/color]
[COLOR=#008080]<[/color][COLOR=#008080]script[/color][COLOR=#008080] [/color][COLOR=#2e8b57][b]language[/b][/color]=[COLOR=#ff00ff]"Object Rexx"[/color][COLOR=#008080]>[/color]
/*---------- msgbox buttons argument constants --------------------*/
vbOKOnly = 0 /* Display OK button only*/
vbOKCancel = 1 /* Display OK and Cancel buttons */
vbAbortRetryIgnore = 2 /* Display Abort, Retry, and Ignore buttons */
vbYesNoCancel = 3 /* Display Yes, No, and Cancel buttons */
vbYesNo = 4 /* Display Yes and No buttons */
vbRetryCancel = 5 /* Display Retry and Cancel buttons */
vbCritical = 16 /* Display Critical Message icon */
vbQuestion = 32 /* Display Warning Query icon */
vbExclamation = 48 /* Display Warning Message icon */
vbInformation = 64 /* Display Information Message icon */
vbDefaultButton1 = 0 /* First button is default */
vbDefaultButton2 = 256 /* Second button is default */
vbDefaultButton3 = 512 /* Third button is default */
vbDefaultButton4 = 768 /* Fourth button is default */
/* Application modal; the user must respond to the message box
before continuing work in the current application */
vbApplicationModal = 0
/* System modal; all applications are suspended until the user responds
to the message box */
vbSystemModal = 4096
/*---------- msgbox return value constants ------------------------*/
VBOK = 1 /* OK */
VBCancel = 2 /* Cancel */
VBAbort = 3 /* Abort */
VBRetry = 4 /* Retry **/
VBIgnore = 5 /*Ignore */
VBYes = 6 /* Yes */
VBNo = 7 /* No */
/*-----------------------------------------------------------------*/
/* Main program */
prompt = "Enter your name: "
title = "Input Panel"
name = input_box(prompt, title)
say "name = '"||name||"'"
select
when name = .nil then do
/* 'The NIL object' */
message = "Program was canceled!"
rc = msg_box(message, vbExclamation, "Warning Panel")
end
when name \= "" then do
prompt = "Hello '"||name||"' from WSH with Open Object Rexx :-)"
rc = msg_box(prompt, vbInformation, "Output panel")
end
otherwise do
message = "Warning: Nothing given!"
rc = msg_box(message, vbCritical, "Warning Panel")
end
end /*select*/
[COLOR=#008080]</script>[/color]
[COLOR=#008080]</job>[/color]
You can run the script simply by double clicking the
Hello_Rexx.wsf file or if you want to see the hidden
says for debugging purposes, then you can use
cscript from command line:
Code:
c:\Users\Roman\Work>cscript /nologo Hello_Rexx.wsf
name = 'mikrom'
c:\Users\Roman\Work>cscript /nologo Hello_Rexx.wsf
name = ''
c:\Users\Roman\Work>cscript /nologo Hello_Rexx.wsf
name = 'The NIL object'