Need Advice from GURU's ...

Bill Campbell linux-sxs
Sun Sep 12 15:31:40 PDT 2004


On Sun, Sep 12, 2004, Ben Duncan wrote:
>As many of you know, I have been a long time AppGen programmer/VAR.
>As of late due to them closing their doors, I have been looking for
>something to replace it with.
>
>It looks like I have found something that can do they job, S-Lang.
>(see http://www.s-lang.org )
>S-lang is noted for it's easy to use and transportable library of
>screen and keyboard handling routines. It also has a VERY powerful
>script language, and now even a "slang" shell. Someone even has
>written a widget set called "newt" in S-Lang that is run under Python
>to form the basis of the Redhat installation system.
>
>I have just spent the past 15 days hacking "newt" to run under the
>S-Lang shell. I guess I have LEARNED more about C programming in the
>past 15 days then I have since I was exposed to it back in 1985!
>
>Ok, now it's time for some terminology to be explained before I go
>any further. These are the terms "Newt" uses.
>
>Screen = actual physical display device
>Root Window = the initial display area on the screen which
>     is the whole physical display area available.
>Window - A virtual display area that can be any size. It sets
>      atop the root window.
>widget set - A library of utilities for creating and displaying:
>      Radio Buttons, Check boxes, Selection List Boxes,
>      radio button bars,information boxes, text input and other such things.
>Grid - A x,y size coordinate for demarcation of a Window
>Form - A list of widgets in FIFO order along with their relative
>      positions inside a Window inside a grid.
>
>In newt , you set a Window, build your widget list (a structure
>pointer is returned for each widget), build your Form using your
>widgets, set your grids, then execute your "Form" (with optional
>grid settings).
>
>The Form then takes over control and simply returns any/all information
> - list box choice numbers, text entries, radio button id ..etc..etc. Form
>runs in "Non-Modal" mode - meaning it is like GUI. All the widgets are
>are displayed within their given location and size settings.
>

>Now, I have successfully gotten newt converted to run under slsh (slang
>shell).  There is no doubt SLAG, as I call it (S-Lang Application
>Generator). which is my system of S-Lang and newt and slsh, can be the next
>Appgen replacement.

>However, here is where the request for advice comes in:

>I do not think that this is how it needs to be done. Having the "widgets"
>are necessary, as is the Windows, but I believe the widgets need to be
>under the direct control of the "SLAG" engine  and the SLADE (S-Lang
>Application definition).

>i.e. : You are on a entry that has say 5 choices. At that time a
>"Selection" box needs to pop up if you hit a "function" key to show you the
>selections.  Or your entry has failed an edit, then a "Text Button Window"
>appears telling you of the error.

The problem I've had with widget based systems it that I don't have the
low-level control processing each character as it's pressed (e.g. ctrl-I to
open a character position under the cursor, ctrl-d to delete the character
under the cursor, ``~'' to change case, ctrl-e to go to the end of the
field, automatically go to next field when the last character is entered,
etc.).  Given that level of control, I generally just go into ``select''
mode when <ENTER> is pressed on an empty field or a question mark is the
first character of the field when <ENTER> is pressed.  Error checking is
done as the last character or <ENTER> is pressed, returning to the field if
there's an error, ringing the bell, and displaying an appropriate message.

The key codes I've used are generally mnemonic (e.g. ctrl-i for insert,
ctrl-d for delete) similar to the codes used in the Radio Shack
``Scripsit'' word processor and function keys based on the rather ancient
Profile 16 and FilePro file management programs since that's what my
customers were often using when I started writing accounting systems in
late 1984.

As a general rule, I don't like using function keys as this requires the
operator to take their hands off the home keys or the numeric keypad.

The early Wyse and DEC terminals I used had F1 through F4 immediately above
the numeric keypad where they were easily used by somebody doing heads down
data entry.  I typically used F1 to insert a character space, F2 to delete
the character under the cursor, F3 to clear to end of field going to the
next field if pressed on a character position other than the left most one,
and F4 to save the current record.  As the standard 101 key PC keyboards
became ubiquitous without these function keys, I then added the same
functionality to the <INSERT>, <DELETE>, <END>, and <PgDown> keys
immediately to the left of the numeric keypad which are easily in reach of
somebody doing 10-key entry.

>I am open to any and all suggestion on this
>
>(Bill, this is probably going to be something that needs to go up on
>libertysoftware.org - let me know ..)

Go for it.  You can create a member account, which will allow you to create
folders, files, etc. on the site (we're using self-signed certificates so
your browser will probably bitch a bit):

	https://www.libertysoft.org/join_form

Here's a presentation I did in July on using Zope and Plone sites:

	http://www.seaslug.org/Members/bill/Presentations/2004_07/

Bill
--
INTERNET:   bill at Celestial.COM  Bill Campbell; Celestial Software LLC
UUCP:               camco!bill  PO Box 820; 6641 E. Mercer Way
FAX:            (206) 232-9186  Mercer Island, WA 98040-0820; (206) 236-1676
URL: http://www.celestial.com/

It is practically impossible to teach good programming style to
students that have had prior exposure to BASIC: as potential
programmers they are mentally mutilated beyond hope of
regeneration.
                -- Dijkstra


More information about the Linux-users mailing list