Re: XForms: how to write a text editor w/xforms?

Steve Lamont (spl@szechuan.ucsd.edu)
Wed, 27 Jan 99 06:27:28 PST

# To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> I've tried using a multi-line edit box but this creates all kinds of
> issues with auto-wraparound, not to mention the slowdown as the file
> size increases. Therefore, I envisage creating a canvas area &
> working on it using Xlib.

By "multi-line edit box" I presume you mean the Input object.

You might consider using some sort of paging scheme, where only the
currently visible text lives in the Input object and the rest of the
text just lives in a buffer. You can then use the editing facilities
of the Input object without creating your own via Xlib. Xlib doesn't
really have any features which are devoted to text editing, _per_se_,
so you'd end up having to reinvent a considerable amount of support
function already in the Input object. I did something similar in a
project a number of years ago (before window systems were commonly
available and mastodons and sabre toothed cats roamed the land).

You may wish to take a look at the LyX editor, which was developed
using XForms for editing LaTeX documents. It has a quite
sophisticated editor.

In closing, I do have to wonder what the motivation of this project
might be. After all, we already do have `emacs', the One True Text
Editor, not to mention its pale imitation, `vi', as more or less
standard issue. Unless this is simply a programming exercise, I'm not
sure I understand why you wish to reinvent not just the wheel but also
the inclined plane, the hammer, the wedge, and, in the case of
`emacs', the gas-operated, clip-fed, calibre 30, shoulder-fired, Swiss
Army knife. :-)

spl
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/