TextField Widget

A low resource single line text input widget designed to mimic the functionality of the Motif XmTextField widget while also being almost a drop-in replacement for the Athena Text widget (in single line mode).


Current Version

The current version is 1.0. Source is available at ftp.x.org.


Overview

The TextField Widget is a low resource single line text input widget designed to mimic the functionality of the Motif XmTextField widget. Most of the functionality of the XmTextField widget is available in my TextField, as well as most of the XmTextField* convenience functions.

To benefit freeware programmers who may now be using the Athena widget set, this widget was also designed to be as compatible as possible with the Athena Text widget (in single line mode). It shares many of the resources with the Athena Text widget, and few code modifications are necessary to change to the TextField. As an added bonus, this widget is very small compared to the Athena Text.

My goal was a powerful free line editor that was similarly powerful to the Motif single line text widget. In particular, I wanted pending delete (replacing text selection with next entry) and scrolling, two features not available in the Athena Text widget. But, besides the small size of the widget and freely available source, there are no obvious advantages to using this widget if you program with Motif (actually, the opposite would be true). Therefore, I have made no attempt to make this widget deal with the idiosyncrasies of Motif. It will certainly operate (to some extent: minus keyboard traversal, highlight borders, etc.) with Motif, but if you use Motif:

  1. You'll use the XmTextField widget
  2. You shouldn't be writing free programs

Take a look at the efforts of the Hungry Programmers for their progress in making a free Motif clone.


Features

Features provided in the widget include the following:


To do list

Possible items to include in future revisions:


Requirements

The TextField code requires X11R4 or later and an ANSI C compiler. The code may compile on a non-ANSI compiler if it supports new style function definitions.


History

This code was developed on a Linux machine running kernel 1.3.* and XFree86 3.1.2 (X11R6). It has also been tested on an IBM RS/6000 running AIX 4.1 and X11R5 and a DEC Alpha/AXP running OSF/1 3.0 with X11R5.


Author's Note

This widget is supplied as free software, in the hope that it will be useful for developers in the X community. It is licensed under the GNU Library General Public License, which is a less restristive version of the GPL. It doesn't prevent the code from being used in commercial codes, as long as you also ship source to the TextField widget. See the file LICENSE in the source distribution for more information.

Patches, improvements, suggestions, bug reports, job offers, volleyball games, and money you love donating to programmers who make your life so much easier are welcome at <rwmcm@orion.ae.utexas.edu>. I will periodically post patches and improvements to ftp.x.org and the TextField web page at http://www.ae.utexas.edu/~rwmcm/TextField.html


Thanks

Thanks to the following people for providing fixes and suggestions:


Copyright

Copyright (c) 1995 Robert W. McMullen

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.

You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

About the author | Send me E-mail | TextField Programmer's Reference | Top of page