This document is part of the JEWL library, copyright © John English 2000. The JEWL library is released for public use under the terms of the GNU General Public License, and may be freely copied, distributed, used and modified under the terms of that license. Suggestions, comments, bug reports and modifications should be reported to the author <firstname.lastname@example.org>.
The latest version of JEWL can be downloaded from the JEWL home site at http://www.it.bton.ac.uk/staff/je/jewl/download.htm.
JEWL (John English's Window Library) is a set of Ada packages aimed at novices which enables reasonably sophisticated GUI applications to be built with a minimum of effort. The rationale behind the development of this library is that beginners are often frustrated with the text-only interface that the standard Ada library provides and complain that they would prefer to learn Visual Basic or Java instead, largely because they can produce modern-looking programs with minimal effort.
The intention of JEWL is to provide a development kit for GUI-based programming in Ada which is sufficiently simple that it can be used from the "Hello world" stage onwards. For this reason the emphasis is on ease of use rather than completeness. Existing GUI packages are often bewildering to novices with the range of facilities they provide, and they achieve flexibility at the price of complexity. As a result, hand-coding a GUI can be extremely difficult. Languages like Visual Basic use a GUI builder to avoid the need for hand-coding, but the code that a GUI builder generates is often difficult to understand (and easy to avoid having to understand). For developing production code this is not an important issue, but in education it can cloud the student's understanding of what is really going on. It is also easy for students to get sidetracked into perfecting the appearance of the user interface at the expense of perfecting the desired functionality.
JEWL is relatively inflexible by comparison with systems intended for developing production code and only provides access to a limited subset range of the underlying facilities, but it is still sufficient for a wide range of novice programs. It is designed so that a program using a graphical interface can be developed by hand-coding, such that the resulting program structure will be similar to an equivalent program with a traditional text-based interface.
There are three primary packages included in JEWL:
JEWL.IO can be used as a more-or-less direct replacement for Ada.Text_IO (although not all the facilities of Ada.Text_IO are supported, and there are some extra features in JEWL.IO), whereas JEWL.Windows is a generic package which is instantiated using a discrete type listing the various commands that GUI controls will be required to generate. JEWL.Simple_Windows is a predefined instantiation of JEWL.Windows which generates values of type Character for the command codes. A program based around JEWL.Windows or JEWL.Simple_Windows will typically use a simple event loop to get the next command from the user interface and respond to it, but the intention is to make programs appear sychronous and procedural rather than event-driven. In particular it would be an easy matter to replace a JEWL GUI user interface with a text-based menu-driven interface, which is not usually the case.
JEWL.IO uses GUI dialogs for input which are built using the facilities of JEWL.Simple_Windows. JEWL.IO, JEWL.Windows and JEWL.Simple_Windows can all be used together in a single program if required.
Documentation for the JEWL packages:
These documents are linked to the following HTML versions of the package specifications:
I hope that you find this library useful, and I welcome any comments or suggestions you might have to help improve it.
John English, January 2001