Virtual OS/2 International Consumer Education
VOICE Home Page: http://www.os2voice.org
August 2002

[Newsletter Index]
[Previous Page] [Next Page]
[Feature Index]

editor@os2voice.org


GpfRexx, GUI Programming Facility for REXX.

By Alan Harrison © August 2002

" GpfRexx is the most comprehensive tool available today for the creation and integration of a Presentation Manager Graphic User Interface into your REXX applications. With the common exception of naming your objects and screens, the bulk of the work is done with the point-and-click method; screens are presented to you in a logical fashion for a complete interface definition."

Considering that the author is still selling it this may be more true than ever. I have been using it for a long time now for small projects like installs and folder setup. I had been using another of his programs, Gpf (a C/C++ GUI builder which I am still using) and decided to purchase GpfRexx for these other tasks. The program interfaces are very similar. The author of both now has his own company and seems to have kept GpfRexx. Gpf is no longer being made available - somebody would have to convince the author to release it. An old demo version is available on Hobbes but the 'Save' option is disabled. He is developing a Java IDE if anybody is interested and is also the developer of Home Page Publisher, an HTML WYSIWYG editor. I haven't had much need for customer support but I have emailed him a few times. He seems quite friendly and helpful.

The JBC Solutions web site lists a price of $45 US for GpfRexx, which is much less than I paid in 1993... I still have the original diskettes but the manual is long gone. I don't expect he supplies those anymore. The web site lists a number of places in North America and Europe where you can purchase GpfRexx. The professional version includes Gpftools which can be used to analyze and document the repository files where GpfRexx stores all the program information. I had a quick look at it way back when but never got around to using it.

A trial version of GpfRexx is available from the developer's web site or on hobbes: http://hobbes.nmsu.edu/cgi-bin/h-viewer?sh=1&fname=/pub/os2/dev/rexx/gpfrx12c.zip. The trial version includes Gpftools and is only limited by the splash screen.

GpfRexx provides for creating all the standard GUI components - buttons, sliders etc. and provides database connectivity through SQL although I never used it. Blocks of Rexx code can be entered into an editor as user functions which are attached to actions of the window components - button clicks, key presses etc. It features an interactive debugger and test facility.

Installation is simple. Unzip the install file and run the install command. Config.sys is updated so a reboot is required. A desktop folder is created with the program components and help file icons. This includes a useful overview of Rexx. A number of samples are also included - how to use GUI components like sliders, use SQL, edit .ini's, use MultiMedia controls etc. The Macaw example will play the video and sound for the old staple. The notebook example is Warp 3 so it may not be possible to use the newer look.

Here is the main GpfRexx window:.

To get started, select File / New, enter a program name and GpfRexx will generate a main window and a Logo window. Click on File / Saveas, give it a filename and GpfRexx will store its repository (.orc) file. Like Gpf, all info about the program is stored in this file. Click on Toolkit / Builder / .exe and GpfRexx will generate an executable you can run. The compiler will save and close the .orc file and open a CLI box for the compile. You can run the program there but will have to reload the .orc file to continue with GpfRexx.

You should have HelloWorld running in a minute or two. Click on the pulldown 'Create / Button /Pushbutton' and a pen mouse pointer will let you drop the button object on the main window. A Settings window then pops up where you can set the text, presentation etc. Click on the 'Action' button and the Actions window will open. Click on 'Add' and the Action List window opens.

Select 'Dismiss' for 'MainWindow' and click on the OKs to close all the settings windows. Build the .exe and run it. Clicking on the button will now close the HelloWorld program.

Double clicking on any component will open the component's settings window. From here, you can set the component's presentation - fonts, colors, etc and assign an icon for your program. Through the 'Entry Help' button, each component can be given its own help text in a text editor dialog. The Toolkit / Builder / .ipf menu item will generate a help source file. This can be compiled to the program help (.hlp) or a system help (.inf) with the IPF Compiler (not included). The settings window also provides for placing components in separate threads. Note that none of the dialogs are resizable. This can make copying items from one instance of GpfRexx to another or debugging a bit difficult.

Each component has a list of events which can have actions attached to them. Highlight an event and click on 'Add' and the Action List dialog appears. Scroll to the bottom of the list and select 'User Function'. A list of the user functions appears at the far right. You as the programmer will create and add to this list of functions and use this screen to attach them to the GUI events.

Note that the program properties setting has the program init and exit actions where any globals can be created / destroyed.

User Function edit window

Here is the user function edit window where programmers will enter their code. As you can see in the editor window, this function starts out by loading the rexx functions, disabling the install button and clearing the info listbox. The panels at the right can be used to select possible actions displayed at the bottom which can then be dragged to the editor. This can save some typing and syntax checking. The editor only holds 4 K of source so modular code is enforced. This can be a significant limitation if you aren't used to writing small subroutines although you can chain functions with a 'Perform('myfunc2','')' call. You can use your preferred editor all you want but will have to cut / paste the code into the GpfRexx editor. There is no code import / export function or version control.

This function is threaded by another function startthread which contains the line:

Install_tid=ATTACH('install')

startthread is then connected as a user function to the mouse click action of the install button so the GUI is not tied up while the install is processing. This makes threading a Rexx program extremely simple.

I found the debugger to be invaluable and easy to use. You can set break points and step through the code, examine variables etc. If nothing else, this feature makes the program worthwhile.

GpfRexx debugger

While I have now ported most of my programs to Java, I still maintain the OS/2 versions and still use GpfRexx occasionally. It has been a very useful tool for me over the years for the fairly simple tasks for which I needed it. I highly recommend it.

References:
GpfRexx 1.2 Level C
Developer: JBC Solutions.- http://www.jbcsolutions.com
Also available on Hobbes: http://hobbes.nmsu.edu/cgi-bin/h-viewer?sh=1&fname=/pub/os2/dev/rexx/gpfrx12c.zip

Price: GpfRexx 2.1 $45US
         GpfRexx Tools Extensions $25US
         GpfRexx Professional (GpfRexx and GpfTools) $59US


[Feature Index]
editor@os2voice.org
[Previous Page] [Newsletter Index] [Next Page]
VOICE Home Page: http://www.os2voice.org