Forms Library
A Graphical User Interface Toolkit for X
V0.81 July 1996
T. C. Zhao
Copyright (©) 1995,1996 by T.C. Zhao and Mark Overmars
Department of Physics, University of Wisconsin-Milwaukee
Milwaukee, WI 53201, USA
and
Mark Overmars
Department of Computer Science, Utrecht University
P.O.Box 80.089, 3508 TB Utrecht, the Netherlands
All rights reserved.
No part of this document may be reproduced, in any form or by any means,
without permission from the authors. Permission to produce
hardcopies in its entirety for private use is granted.
Window-based user interfaces are becoming a common and required feature for most computer systems, and as a result, users have come to expect all applications to have polished user-friendly interfaces. Unfortunately, constructing user interfaces for programs is in general a time consuming process. In the last few years a number of packages have appeared that help build up graphical user interfaces (so-called GUI's) in a simple way. Most of them, though, are difficult to use and/or expensive to buy and/or limited in their capabilities. The Forms Library was constructed to remedy this problem. The design goals when making the Forms Library were to create a package that is intuitive, simple to use, powerful, graphically good looking and easily extendable.
The main notion in the Forms Library is that of a form. A form is a window on which different objects are placed. Such a form is displayed and the user can interact with the different objects on the form to indicate his/her wishes. Many different classes of objects exist, like buttons (of many different flavors) that the user can push with the mouse, sliders with which the user can indicate a particular setting, input fields in which the user can provide textual input, menus from which the user can make choices, browsers in which the user can scroll through large amounts of text (e.g. help files), etc. Whenever the user changes the state of a particular object on one of the forms displayed the application program is notified and can take action accordingly. There are a number of different ways in which the application program can interact with the forms, ranging from very direct (waiting until something happens) to the use of callback routines that are called whenever an object changes state.
The application program has a large amount of control over how objects are drawn on the forms. It can set color, shape, text style, text size, text color, etc. In this way forms can be fine tuned to one's liking.
The Forms Library consists of a large number of C-routines to build up interaction forms with buttons, sliders, input fields, dials, etc. in a simple way. The routines can be used both in C and in C++ programs. The library uses only the services provided by the Xlib and should run on all workstations that have X installed on them. The current version needs 4bits of color (or grayscale) to look nice, but it will function properly on workstations having less depth (e.g., XForms works on B&W X-terminals).
The library is easy to use. Defining a form takes a few lines of code and interaction is fully handled by the library routines. A number of demo programs are provided to show how easy forms are built and used. For simple forms and those that may be frequently used in application programs, e.g., to ask a question or select a file name, special routines are provided. For example, to let the user choose a file in a graphical way (allowing him/her to walk through the directory hierarchy with a few mouse clicks) the application program needs to use just one line of code.
To make designing forms even easier a Form Designer is provided. This is a program that lets you interactively design forms and generate the corresponding C-code. You simply choose the objects you want to place on the forms from a list and draw them on a form. Next you can set attributes, change size and position of the objects, etc., all using the mouse.
Although this document describes all you need to know about using the Forms Library for X, it is not an X tutorial. On the contrary, details of programming in X are purposely hidden in the Forms Library interfaces, and one need not be an X-expert to use the Forms Library, although some knowledge of how X works would help to understand the inner workings of the Forms Library.
Forms Library and all the programs either described in this document or distributed as demos have been tested under X11 R4, R5 & R6 on all major UNIX platforms, including SGI, SUN, HP, IBM RS6000/AIX, Dec Alpha/OSF1, as well as PC/Linux, PC/FreeBSD/NetBSD, SCO and Unixware.
This document consists of four parts. The first part is a tutorial that provides an easy, informal introduction to the Forms Library. This part should be read by everybody that wants to use the library. You are encouraged to try variations of the demo programs distributed in the Forms Library package.
Part ii describes the Form Designer with which you can design forms interactively and have Form Designer write code for you.
Part iii gives an overview of all object classes currently available in the library. The tutorial part only mentions the most basic classes but here you find a complete overview.
Adding new object classes to the system is not very complicated. Part iv describes how this should be done.
The authors request that the following name(s) be used when referring to this toolkit
XForms
Forms Library for X
or simply
Forms Library \
Forms Library is not public domain. It is copyright (©)
by T.C. Zhao and Mark Overmars, with all published and unpublished
rights reserved. However, permission to use for non-commercial
and non-profit purposes is granted. Commercial program
developers (for in-house use or otherwise) must contact the authors
(xforms@world.std.com
) for a license arrangement.
This software is provided ``as is'' without warranty of any kind, either expressed or implied. The entire risk as to the quality and performance of the software is with you. Should the software prove defective, you assume the cost of all necessary servicing, repair or correction and under no circumstance shall the authors be liable for any damages resulting from the use or mis-use of this software.
Figures in this document were produced by
fd2eps
, a program that takes the output of the form designer
and converts the form definition into an encapsulated POSTSCRIPT
file.
This document is dated July 4, 1996 .
Although XForms has gone through extensive testing, there are most likely a number of bugs remaining. Your comments would be greatly appreciated. Please send any bug reports or suggestions to T.C. Zhao (zhao@bragg.phys.uwm.edu). Please do not expect an immediate response, but we do appreciate your input and will do our best.
As of this writing, perl
, python
, and Ada95
bindings to the Forms Library are in beta. Follow the links on XForms's
home page to get more info on these bindings.
Permanent home for the Forms Library is at
ftp://laue.phys.uwm.edu/pub/xforms ftp://ftp.cs.ruu.nl/pub/XFORMS (mirror site) ftp://imageek.york.cuny.edu/xforms (mirror site)
For additional mirrors, html version of this document, news and other info related to XForms can be accessed through www via the following URL
http://bragg.phys.uwm.edu/xforms
In addition to ftp and www server, a mail server is available for those who do not have direct internet access.
To use the mail server, send a message to mail-server@cs.ruu.nl
or the old-fashioned path alternative
uunet!mcsun!sun4nl!ruuinf!mail-server
.
The message should be something like the following
begin path fred@stone.age.edu (substitute your address) send help end
To get a complete listing of the archive tree, issue send ls-lR.Z.
A mailing list for news and discussions about XForms is available. To subscribe or un-subscribe, send a message to listserv@ra.york.cuny.edu with one of the following commands as the mail body
help subscribe xforms unsubscribe xforms
To use the mailing list, send mail to xforms@ra.york.cuny.edu. Please remember that the message will be sent to hundreds of people. Please Do not send subscribe/unsubscribe messages to the mailing list, send them to listserv@ra.york.cuny.edu.
Currently GE Medical
Systems, P.O. Box 414, NB-922, Milwaukee, WI 53201-0414