GUI

Server ezwindow utility System i GUI Introduction (IBM i)

The ezwindow utility (single PASE binary) enables typical business dialog GUI programming for many languages including ILE RPG, ILE c, perl, ksh, php, etc (images below). The two functional parts in the download are the PASE ezwindow binary, and ILE RPG/c interface SRVPGM that you compile on your own, all other parts are demos (see Download).

Client quick glance (Linux, Mac, Windows)

We connect to our IBM i thru client access. Do we have to install anything on our PC, running windows XP, before we can show a window from a RPG-program ?

  • A1 (yes): Windows requires additional X emulation … i use Cygwin - X for Windows (see Client Pgms)
  • A2 (no): Linux/Mac X enabled by default (cool) … i use ssh -X adc@myibmi every day to edit programs, run commands, etc. (see SSHSetup and/or read Quick sheet ssh -X to enable IBM i on this page)

RPG can do GUI

RPG programmer in a hurry take a look at RPG Reference Guide compile, run, debug and you will get the ezwindow idea. The ezwindow utility/source code posted are “as is” samples that you can view/copy/use for your own X based PASE/RPG projects (see License and check the author note bottom of this page).

These windows were generated by RPG on V5R3 System i using the ezwindow binary and rendered on my Windows PC and/or my Linux PC using ssh -X/-Y my400 (see Samples).

Documentation

  • Reference Guide - ezwindows window definition language
  • User’s Guide - ezwindows detailed user information
  • RPG Reference Guide - ILE RPG ezwindows API
  • Samples - samples of ILE RPG, ILE c, perl, KornShell (ksh), PHP, etc.
  • License - code license and disclaimer information
  • X windows setup:
    • Client Pgms - client setup information and available free X packages for Windows (encrypted communications)
    • SSHSetup - System i setup sshd server (encrypted communications).

Quick sheet ssh -X

1) Enable X Windows forwarding by editing the sshd_config file to enable X11Forwarding yes:
 on V5R3 or V5R4:
   /QOpenSys/QIBM/UserData/SC1/OpenSSH/openssh-3.5p1/etc/sshd_config 
 on V6R1:
   /QOpenSys/QIBM/UserData/SC1/OpenSSH/openssh-3.8.1p1/etc/sshd_config

2) Start sshd server side (i5/OS):
 on V5R3 or V5R4:
   CALL QP2TERM
   >/usr/sbin/sshd &
 on V6R1:
   STRTCPSVR *SSHD

3) Initiate ssh connection from client side (linux works very well):
 >ssh -X myi5 (ssh -Y if "bad atom" or graphics problems)
 -- or --
 >ssh -X myuserid@myi5.xxx.org (if your PC is not same user name)

Author note

The ezwindow utility is a sample way to program a GUI user interface for RPG and other System i programming languages using PASE X support (PASE probably already installed on your i machine). ezwindow is not intended to be a strategic replacement of DDS, or a System i strategic GUI direction, or a web programming alternative, or a primary production application, and so on, these are philosophical topics beyond the scope of this RPG coding sample. The original ezwindow utility was part of the AIX developer packages, but has fallen out of service, we are releasing it here with source code for those customers that saw an RPG demo and wanted to try the utility. I hope you enjoy the easy RPG GUI programming using the ezwindow utility (“as is”), it is very entertaining to see RPG programs pop up usable GUI windows.

My primary PCs are Linux-Ubuntu (me) and Mac (wife and daughters). I use ssh -X/-Y for seamless integration of windows/applications on my Linux desktop that are often actually running on 5 or more different remote systems (mostly System i or AIX servers), all ssh communications are encrypted.

Windows PC … I have Cygwin+ssh+X installed on my Windows machine and all the RPG GUI examples worked just fine with that configuration (as did AIX, Linux and other System i applications). You may find that having an X server product on your Windows machine becomes a habit forming way of working with System i, AIX and Linux servers (welcome).

The ezwindow support works best on local attached networks, if you use it over remote networks with many communication hops things may get very slow. Also, you should have a modern POWER System i with good speed and memory.

Author(s)

Tony “Ranger” Cairns - IBM i PHP / PASE