![]() getgui home |
getgui
SYNOPSISgetgui -i other optionsDESCRIPTIONgetgui is a simple graphical user interface (GUI) box that can be invoked from the command line or from shell scripts to get user responses using buttons and/or key input. The user selection is written to standard output, where it may be captured by the calling script.getgui may also be used from C programs via its simple C language API . In this mode, the user's selection is made available to the calling program in a variable. This API has some additional capabilities that the command line utility does not have. Primary uses are as an "in progress" popup to keep users complacent while slow-to-start GUI apps are revving up, or as a pop-up alarm clock, or as a step-by-step procedural interface for "wizard" or process control applications.
Typing getgui with no arguments prints a usage message and
shows a general idea of what the getgui box will look like.
AVAILABILITYhttp://ploticus.sourceforge.net/getguiSIMPLE EXAMPLEHere's the easiest way to use getgui. Just type: getgui -i
You will be prompted for a message and a time (24 hour notation).
The getgui box will then disappear, reappearing at the appointed time
with the given message.
EXAMPLE - C PROGRAM APISee the included ggdemo program.EXAMPLES - COMMAND LINE TOOLFor these examples, /bin/sh is assumed.Example 1
![]() LNAME=`getgui -prompt "Please select a login" -buttons jim,sysman,faxserv `
When the user
selects a button, its label is written to standard output,
where the shell (/bin/sh) captures it into variable LNAME.
Then the GUI box terminates.
Example 2 ![]() FILE=`getgui -prompt "Enter a file name" -keyinput 24 -buttons Cancel`
The user may type in a file name or click on the Cancel button.
Either the typed result, or the word Cancel
is written to standard output,
where the shell captures it into variable FILE.
Then the GUI box terminates.
Example 3
![]() REMARK=`getgui -prompt "Enter your comments" -winsize 5,3 -editbox 200 -buttons OK,Cancel
The user may enter comments into the editbox, and edit using arrow keys,
backspace, delete, ^K to delete a line, etc. (see KEYS below). Then,
when finished, the user can press the OK key, in which case the typed
comments will be written to standard output where they are captured by
the shell (/bin/sh) into the variable REMARK. Or, if the user
wishes to cancel without typing anything, the Cancel key may be pressed,
which will cause the word ancel to be written to standard output.
OPTIONSThese command line options may be given in any order, and in any combination unless specifically prohibited:-i
-prompt s
-buttons blist
-keyinput nchars
-editbox nchars
-initvalue s
-initfile f
-winloc x,y
-winsize w,h
-promptfile f
-delaysec sec
-attime hh:mm
-pw
-exec command
-set attribute value
NOTESButtons may be combined with either a key input field or an edit box if desired.
For consistent appearance
it may be useful to store -winsize, -winloc, and any -set arguments
in a shell variable and use for all invocations within a script.
KEYSThe key entry field and editbox support the VT100/xterm arrow keys and the standard editing keys used in netscape, pico, etc.Arrow keys move cursor Home or Ctrl-A cursor to beginning of line End or Ctrl-E cursor to end of line Ctrl-K delete to end of line Ctrl-U delete all of current line COLORSColors may be specified by pre-defined name, by RGB specification, or by gray level specification. A number of named colors have been defined. These include:
white black red magenta tan1 tan2 coral claret pink orange redorange lightorange yellow yellow2 dullyellow yelloworange brightgreen green teal drabgreen kelleygreen yellowgreen limegreen brightblue blue powderblue skyblue cobaltblue darkblue oceanblue purple lightpurple lavender If none of the pre-named colors suit, a custom RGB specification in the form of rgb(R,G,B) may be used. R, G, B are values from 0.0 to 1.0 (1.0 is brightest) specify the red, green and blue components. No embedded spaces are allowed. Example: rgb(0.4,0.84,0.37)
It is also possible to specify a gray-level in the form of
gray(G) or just G,
where G is 0.0-1.0 grey level (1.0 is white).
No embeddded spaces are allowed. Example: gray(0.8)
BUGSIf X11 color map is full, colors are usually displayed inaccurately.For best results use an X window manager that does not require human interaction for placing new windows.
There is no scrolling listbox.
SEE ALSOgetguilib(3)AUTHORSteve Grubb |
![]() Copyright Steve Grubb |