home page
Manual page for Illustrated(examples)

getgui illustrated examples

Most of these examples are screen shots taken from the interactive demo that is included with the getgui distribution. Some examples are shown with window border, others without. Window border is controlled by your local window manager.

Command line options are all described on the getgui(1) manual page.

getgui writes the user's selection to standard output. To capture the result into a shell variable, use backquotes as shown. Since getgui can return a zero length value in some cases, the result variable should be quoted as shown if you're using shell script test statements. If you're invoking getgui from perl or other language environments, the method for capturing standard output will vary.

# Here's a general example of how to use getgui in a shell script:
SER=` getgui "Enter serial#" -keyin 12 `
if [ "$SER" = "" ]; then
  echo "You entered $SER ."

The following are some illustrated examples:

getgui "Welcome to getgui 2.0"

getgui "Note that the message can
        be any number of lines,
        and the window size and
        layout adjusts automatically." -buttons "Seems reasonable"

getgui "Here's a simple dialog box with buttons:"  -buttons "Yes|No|Maybe"

getgui "Buttons can be multicolored,\nand have drop shadows like this:" \ 
	-buttons "Mark as read|Save for later|Quit" -btncolor "multi"  -btndress drop

getgui "Select a file:" -filepick -dir play_dir -updir 

getgui "Enter a name for this build:" -keyin 12  -horiz  -initval "generic1" \ 
	-buttons "OK|Cancel" -keysize 16

getgui "Enter password:" -password 12  -horiz 

text="This is a fictional\ndemonstration of a\nshell-script-based\n\"wizard\" interface."

getgui -horiz -msg "$text" -title "Wizard demo" -buttons "Next|Close" 

prompt="Some helpful info
        about the nodes
        can be shown here."

getgui -title "Select a node"  -msg "$prompt"  -horiz  -shortpick  -initval "devA"  \ 
-selectbox  "devA - Development node A\ndevB - Development node B\ntest1 - Test node 1"  \ 
-buttons "Help|Back|Next|Close"  -okstr Next  -btncolor gray:0.9 `

list="1.  Info box
2.  Dialog box with buttons
3.  File select box
4.  Key entry field
5.  Password entry field
6.  Pulldown selection box
7.  Single-choice selection box
8.  Multi-choice selection box
9.  In-progress box (splash screen)
10. Shellscript-based wizard interface demo
11. File select demo w/ navigation"

getgui -title "Welcome to GETGUI 2.0" -msg "Select one:"  \ 
       -selectbox "$list"  -buttons "Go|Quit" -shortpick -initval "$CHOICE" -okstr Go  `

getgui -msg "Show correlations better than:" -pulldown "0.98\n0.95\n0.9\n0.8\n0.7" \ 
       -horiz  -initval 0.9  -buttons "OK"

Copyright statement

Markup created by unroff 1.0,    March 02, 2005.