8. Scribe User Manual -- Graphical User Interfaces

8. Scribe User Manual -- Graphical User Interfaces

Browsing

Home: Scribe User Manual

Previous chapter: Computer programs
Next chapter: Customization

Graphical User Interfaces

8.1 Form
8.2 Label widget
8.3 Entry widget
8.4 Password widget
8.5 Button widget
8.6 Checkbutton widget
8.7 Radio widget
8.8 File selector
8.9 Text widget
8.10 Listbox widget
8.11 Combobox widget

Chapters

1. Getting Started
2. Syntax
3. Standard Library
4. Hyperlinks and References
5. Index
6. Bibliography
7. Computer programs
8. Graphical User Interfaces
9. Customization
10. Scribe style files
11. Editing Scribe Programs
12. Compiling Scribe programs
13. Compiling Texi documents
14. Using Bibtex databases
15. Functions and Variables

Scribe

Home page:Scribe

Documentation:user
expert
styles

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.

8.1 Form

(form :url [:submit "Submit"] [:submit-name "submit"] [:reset "Reset"] [:reset-name "reset"] [:options '()] [:method #f] . exp)Scribe Gui function

argumentdescription
:urlThe URL of the program handling the form.
:submitThe user string describing the form submit button.
:submit-nameThe internal string describing the form submit button.
:resetThe user string describing the form reset button.
:reset-nameThe internal string describing the form reset button.
:optionsA list of couples (name, value) that are passed to the URL when the form is submitted.
:methodThe 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.
expThe Scribe expressions composing the form.

8.2 Label widget

(label . body)Scribe Gui function

A text in a graphical user interface.

8.3 Entry widget

(entry :name [:width 40] . exp)Scribe Gui function

A text entry in a graphical user interface.

argumentdescription
:nameThe name of the widget.
:widthThe number of characters composing the entry.
expThe 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:

8.4 Password widget

(password :name [:width 20])Scribe Gui function

A text entry for typing in password in a graphical user interface.

argumentdescription
:nameThe name of the widget.
:widthThe 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:

8.5 Button widget

(button :name . exp)Scribe Gui function

A button in a Gui.

argumentdescription
:nameThe name of the widget.
expThe text of the button.

The example:

(form :url "http://nowhere.com" :submit #f :reset #f [
,(button :name "a-button" "Click me")])

produces:

8.6 Checkbutton widget

(checkbutton :name . exp)Scribe Gui function

A check button in a Gui.

argumentdescription
:nameThe name of the widget.
expThe 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:

Italic Bold Underline

8.7 Radio widget

(radio :name [:orientation 'horizontal] [:value #f] . items)Scribe Gui function

A check button in a Gui.

argumentdescription
:nameThe name of the widget.
:orientationShould be horizontal or vertical
:valueThe selected value of the radio group.
itemsThe 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:

  • An horizontal radio group: foo bar gee
  • A vertical radio group:
    foo
    bar
    gee

8.8 File selector

(fileselector :name [:width 40])Scribe Gui function

A file selector widget.

argumentdescription
:nameThe name of the widget.
:widthThe width of the selector.

The example:

(form :url "http://nowhere.com" :submit #f :reset #f [
A file selector: ,(fileselector :name "fselect")])

produces:

A file selector:

8.9 Text widget

(text :name [:cols 40] [:rows 20] [:read-only #f] . exp)Scribe Gui function

A text editor.

argumentdescription
:nameThe name of the widget.
:colsThe width of the widget.
:rowsThe height of the widget.
:read-onlyA boolean that controls if it is possible to edit the text.
expThe 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:

An editable text editor:
Another one that cannot be edited:

8.10 Listbox widget

(listbox :name [:height 10] [:selected-items '()] . items)Scribe Gui function

A listbox widget.

argumentdescription
:nameThe name of the widget.
:heightThe number of items simultaneously displayed.
:selected-itemsThe pre-selected items.
itemsThe 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:

8.11 Combobox widget

(combobox :name [:selected-items #f] . items)Scribe Gui function

A Combobox widget.

argumentdescription
:nameThe name of the widget.
:selected-itemThe pre-selected item(s).
itemsThe 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:


This page has been generated by Scribe.
Last update Wed Dec 18 09:23:02 2002