Graphical User Interfaces
Form
Label widget
Entry widget
Password widget
Button widget
Checkbutton widget
Radio widget
File selector
Text widget
Listbox widget
Combobox widget
Getting Started
Syntax
Standard Library
Hyperlinks and References
Index
Bibliography
Computer programs
Graphical User Interfaces
Customization
Scribe style files
Editing Scribe Programs
Compiling Scribe programs
Compiling Texi documents
Using Bibtex databases
Functions and Variables
Some target formats support dynamic documents . For those
targets Scribe propose a Graphical User Interface
(henceforth Gui) toolkit. Currently only the HTML back-end
supports the Scribe Gui facility. The functions composing it are
described in this chapter.
Scribe only supports disconnected interfaces. That
is a Scribe Gui is defined by a form that contains
several widgets . Users fill the widgets and when the selection
is completed, they submit the form. Submitting a form means
that choices proposed by the form are sent to a specific program.
This program is declared in the :url field of the
form function call. All widgets composing
a Gui must be passed to a form. It is meaningless to specify
a widget that is not passed to a form .
( form :url [:submit "Submit"] [:submit-name "submit"] [:reset "Reset"] [:reset-name "reset"] [:options '()] [:method #f] . exp ) Scribe Gui function
argument description
:url The URL of the program handling the form.
:submit The user string describing the form submit button.
:submit-name The internal string describing the form submit button.
:reset The user string describing the form reset button.
:reset-name The internal string describing the form reset button.
:options A list of couples (name, value) that are passed to the
URL when the form is submitted .
:method The boolean
or a string that can either
be post or get . This flag impacts the way the program
handling the form will be called. For a detailed description see the
HTML form specification .
exp The Scribe expressions composing the form.
( label . body ) Scribe Gui function
A text in a graphical user interface.
( entry :name [:width 40] . exp ) Scribe Gui function
A text entry in a graphical user interface.
argument description
:name The name of the widget.
:width The number of characters composing the entry.
exp The default initial value of the entry.
The example:
(form :url "http://www.google.com/search" :submit-name "btnG" :submit "search..." [
,(label "Google: " )
,(entry :name "q" :width 50)] )
produces:
( password :name [:width 20]) Scribe Gui function
A text entry for typing in password in a graphical user interface.
argument description
:name The name of the widget.
:width The number of characters composing the entry.
The example:
(form :url "http://nowhere.com" :submit #f :reset #f [
,(label "Password: " )
,(password :name "pwd" :width 50)] )
produces:
( button :name . exp ) Scribe Gui function
A button in a Gui.
argument description
:name The name of the widget.
exp The text of the button.
The example:
(form :url "http://nowhere.com" :submit #f :reset #f [
,(button :name "a-button" "Click me" )] )
produces:
( checkbutton :name . exp ) Scribe Gui function
A check button in a Gui.
argument description
:name The name of the widget.
exp The value of the checkbutton.
The example:
(form :url "http://nowhere.com" :submit #f :reset #f [
,(checkbutton :name "italic" "Italic" )
,(checkbutton :name "bold" "Bold" )
,(checkbutton :name "underline" "Underline" )] )
produces:
( radio :name [:orientation 'horizontal] [:value #f] . items ) Scribe Gui function
A check button in a Gui.
argument description
:name The name of the widget.
:orientation Should be horizontal
or vertical
:value The selected value of the radio group.
items The items of the radio group.
The example:
(form :url "http://nowhere.com" :submit #f :reset #f [
,(itemize (item [ An horizontal radio group: ,(radio :name "a-radio"
:orientation 'horizontal
:value "bar"
"foo" "bar" "gee" )] )
(item [ A vertical radio group: ,(linebreak )
,(radio :name "a-radio2"
:orientation 'vertical
"foo" "bar" (list "gee" (bold "gee" )))] ))] )
produces:
( fileselector :name [:width 40]) Scribe Gui function
A file selector widget.
argument description
:name The name of the widget.
:width The width of the selector.
The example:
(form :url "http://nowhere.com" :submit #f :reset #f [
A file selector: ,(fileselector :name "fselect" )] )
produces:
( text :name [:cols 40] [:rows 20] [:read-only #f] . exp ) Scribe Gui function
A text editor.
argument description
:name The name of the widget.
:cols The width of the widget.
:rows The height of the widget.
:read-only A boolean that controls if it is possible to edit the
text.
exp The default characters of the text widget.
The example:
(form :url "http://nowhere.com" :submit #f :reset #f [
An editable text editor: ,(text :name "gee" :rows 5 [ This is
a pre-initialized text
that may contain newlines] )
,(linebreak )
Another one that cannot be edited:
,(text :name "gee" :rows 5 :read-only #t [ This is
another text
that cannot be edited.] )] )
produces:
( listbox :name [:height 10] [:selected-items '()] . items ) Scribe Gui function
A listbox widget.
argument description
:name The name of the widget.
:height The number of items simultaneously displayed.
:selected-items The pre-selected items.
items The items of the listbox widget.
The example:
(form :url "http://nowhere.com" :submit #f :reset #f [
A list box: ,(listbox :name "lstbox" :height 4
:selected-items '("Scheme" "Lisp" )
"Scheme"
"Lisp"
"Caml"
"Haskell"
"Sml/NJ"
"Common Lisp"
"Emacs Lisp" )] )
produces:
A list box:
Scheme
Lisp
Caml
Haskell
Sml/NJ
Common Lisp
Emacs Lisp
( combobox :name [:selected-items #f] . items ) Scribe Gui function
A Combobox widget.
argument description
:name The name of the widget.
:selected-item The pre-selected item(s).
items The items of the listbox widget.
The example:
(form :url "http://nowhere.com" :submit #f :reset #f [
A combobox: ,(combobox :name "lstbox"
:selected-item "Scheme"
"Scheme"
"Lisp"
"Caml"
"Haskell"
"Sml/NJ"
"Common Lisp"
"Emacs Lisp" )] )
produces:
A combobox:
Scheme
Lisp
Caml
Haskell
Sml/NJ
Common Lisp
Emacs Lisp