| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Most graphical user interface toolkits provide
a number of standard user interface controls (sometimes known as
`widgets' or `gadgets'). Historically, Emacs didn't support anything like
this, except for its incredible powerful text "widget". However,
since XEmacs 21.4, XEmacs has supported "native" widgets (GUI controls
implemented as Lisp APIs in C for the MS Windows, Motif, Athena, and GTK
toolkits) and libglade (GUI controls with an XML API for the GTK
toolkit). On the other hand, Emacs does provide the necessary
primitives to implement many other widgets within a text buffer, and of
course this is the only way to implement self-contained controls in a
text terminal. The widget package simplifies this task.
Examples of some basic widgets include:
link
push-button
editable-field
menu-choice
radio-button-choice
item
menu-choice and
radio-button-choice widgets.
choice-item
toggle
checkbox
editable-list
Now, of what possible use can support for widgets be in a text editor? I'm glad you asked. The answer is that widgets are useful for implementing forms. A form in Emacs is a buffer where the user is supposed to fill out a number of fields, each of which has a specific meaning. The user is not supposed to change or delete any of the text between the fields. Examples of forms in Emacs are the `forms' package (of course), the customize buffers, the mail and news compose modes, and the HTML form support in the `w3' browser.
The advantages for a programmer of using the widget package to
implement forms are:
In order to minimize the code that is loaded by users who does not create any widgets, the code has been split in two files:
define-widget, and autoloads the function widget-create.
In order to minimize the code that is loaded by users who does not create any widgets, the code has been split in two files:
widget-define, and autoload the function widget-create.
| [ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |