-This is Info file ../info/widget.info, produced by Makeinfo version
-1.68 from the input file widget.texi.
+This is ../info/widget.info, produced by makeinfo version 4.0 from
+widget.texi.
INFO-DIR-SECTION XEmacs Editor
START-INFO-DIR-ENTRY
-* Widgets: (widget). The Emacs Widget Library.
+* Widgets: (widget). The Emacs Widget Library.
END-INFO-DIR-ENTRY
\1f
The advantages for a programmer of using the `widget' package to
implement forms are:
- 1. More complex field than just editable text are supported.
+ 1. More complex fields than just editable text are supported.
2. You can give the user immediate feedback if he enters invalid data
in a text field, and sometimes prevent entering invalid data.
There are several different kind of buttons, all of which are
present in the example:
-*The Option Field Tags.*
+_The Option Field Tags._
When you invoke one of these buttons, you will be asked to choose
between a number of different options. This is how you edit an
option field. Option fields are created by the `menu-choice'
widget. In the example, `Choose' is an option field tag.
-*The `[INS]' and `[DEL]' buttons.*
+_The `[INS]' and `[DEL]' buttons._
Activating these will insert or delete elements from a editable
list. The list is created by the `editable-list' widget.
-*Embedded Buttons.*
+_Embedded Buttons._
The `_other work_' is an example of an embedded button. Embedded
buttons are not associated with a fields, but can serve any
purpose, such as implementing hypertext references. They are
usually created by the `link' widget.
-*The `[ ]' and `[X]' buttons.*
+_The `[ ]' and `[X]' buttons._
Activating one of these will convert it to the other. This is
useful for implementing multiple-choice fields. You can create it
wit
-*The `( )' and `(*)' buttons.*
+_The `( )' and `(*)' buttons._
Only one radio button in a `radio-button-choice' widget can be
selected at any time. When you invoke one of the unselected radio
buttons, it will be selected and the previous selected radio
button will become unselected.
-*The `[Apply Form]' `[Reset Form]' buttons.*
+_The `[Apply Form]' `[Reset Form]' buttons._
These are explicit buttons made with the `push-button' widget.
The main difference from the `link' widget is that the buttons are
will be displayed as GUI buttons when possible. enough.
buffer, plus you will have these additional commands:
`<TAB>'
- - Command: widget-forward &optional COUNT
+ - Command: widget-forward &optional count
Move point COUNT buttons or editing fields forward.
`<M-TAB>'
- - Command: widget-backward &optional COUNT
+ - Command: widget-backward &optional count
Move point COUNT buttons or editing fields backward.
\1f
(make-local-variable 'widget-example-repeat)
(widget-insert "Here is some documentation.\n\nName: ")
(widget-create 'editable-field
- :size 13
- "My Name")
+ :size 13
+ "My Name")
(widget-create 'menu-choice
- :tag "Choose"
- :value "This"
- :help-echo "Choose me, please!"
- :notify (lambda (widget &rest ignore)
- (message "%s is a good choice!"
- (widget-value widget)))
- '(item :tag "This option" :value "This")
- '(choice-item "That option")
- '(editable-field :menu-tag "No option" "Thus option"))
+ :tag "Choose"
+ :value "This"
+ :help-echo "Choose me, please!"
+ :notify (lambda (widget &rest ignore)
+ (message "%s is a good choice!"
+ (widget-value widget)))
+ '(item :tag "This option" :value "This")
+ '(choice-item "That option")
+ '(editable-field :menu-tag "No option" "Thus option"))
(widget-insert "Address: ")
(widget-create 'editable-field
- "Some Place\nIn some City\nSome country.")
+ "Some Place\nIn some City\nSome country.")
(widget-insert "\nSee also ")
(widget-create 'link
- :notify (lambda (&rest ignore)
- (widget-value-set widget-example-repeat
- '("En" "To" "Tre"))
- (widget-setup))
- "other work")
+ :notify (lambda (&rest ignore)
+ (widget-value-set widget-example-repeat
+ '("En" "To" "Tre"))
+ (widget-setup))
+ "other work")
(widget-insert " for more information.\n\nNumbers: count to three below\n")
(setq widget-example-repeat
- (widget-create 'editable-list
- :entry-format "%i %d %v"
- :notify (lambda (widget &rest ignore)
- (let ((old (widget-get widget
- ':example-length))
- (new (length (widget-value widget))))
- (unless (eq old new)
- (widget-put widget ':example-length new)
- (message "You can count to %d." new))))
- :value '("One" "Eh, two?" "Five!")
- '(editable-field :value "three")))
+ (widget-create 'editable-list
+ :entry-format "%i %d %v"
+ :notify (lambda (widget &rest ignore)
+ (let ((old (widget-get widget
+ ':example-length))
+ (new (length (widget-value widget))))
+ (unless (eq old new)
+ (widget-put widget ':example-length new)
+ (message "You can count to %d." new))))
+ :value '("One" "Eh, two?" "Five!")
+ '(editable-field :value "three")))
(widget-insert "\n\nSelect multiple:\n\n")
(widget-create 'checkbox t)
(widget-insert " This\n")
(widget-create 'checkbox nil)
(widget-insert " That\n")
(widget-create 'checkbox
- :notify (lambda (&rest ignore) (message "Tickle"))
- t)
+ :notify (lambda (&rest ignore) (message "Tickle"))
+ t)
(widget-insert " Thus\n\nSelect one:\n\n")
(widget-create 'radio-button-choice
- :value "One"
- :notify (lambda (widget &rest ignore)
- (message "You selected %s"
- (widget-value widget)))
- '(item "One") '(item "Another One.") '(item "A Final One."))
+ :value "One"
+ :notify (lambda (widget &rest ignore)
+ (message "You selected %s"
+ (widget-value widget)))
+ '(item "One") '(item "Another One.") '(item "A Final One."))
(widget-insert "\n")
(widget-create 'push-button
- :notify (lambda (&rest ignore)
- (if (= (length (widget-value widget-example-repeat))
- 3)
- (message "Congratulation!")
- (error "Three was the count!")))
- "Apply Form")
+ :notify (lambda (&rest ignore)
+ (if (= (length (widget-value widget-example-repeat))
+ 3)
+ (message "Congratulation!")
+ (error "Three was the count!")))
+ "Apply Form")
(widget-insert " ")
(widget-create 'push-button
- :notify (lambda (&rest ignore)
- (widget-example))
- "Reset Form")
+ :notify (lambda (&rest ignore)
+ (widget-example))
+ "Reset Form")
(widget-insert "\n")
(use-local-map widget-keymap)
(widget-setup))
functions, until it is deleted with `widget-delete'. After the widgets
have been created, `widget-setup' must be called to enable them.
- - Function: widget-create TYPE [ KEYWORD ARGUMENT ]...
+ - Function: widget-create type [ keyword argument ]...
Create and return a widget of type TYPE. The syntax for the TYPE
argument is described in *Note Basic Types::.
The keyword arguments can be used to overwrite the keyword
arguments that are part of TYPE.
- - Function: widget-delete WIDGET
+ - Function: widget-delete widget
Delete WIDGET and remove it from the buffer.
- Function: widget-setup
NAME ::= (NAME [KEYWORD ARGUMENT]... ARGS)
| NAME
- Where, NAME is a widget name, KEYWORD is the name of a property,
+ where NAME is a widget name, KEYWORD is the name of a property,
ARGUMENT is the value of the property, and ARGS are interpreted in a
widget specific way.
Text around %[ %] in the format.
These can be
- *nil*
+ _nil_
No text is inserted.
- *a string*
+ _a string_
The string is inserted literally.
- *a symbol*
+ _a symbol_
The value of the symbol is expanded according to this table.
`:doc'
- The string inserted by the `%d' escape in the format string.
+ The string inserted by the `%d' or `%h' escape in the format
+ string.
`:tag'
The string inserted by the `%t' escape in the format string.
specified value.
`:validate'
- A function which takes a widget as an argument, and return nil if
+ A function which takes a widget as an argument, and returns nil if
the widget's current value is valid for the widget. Otherwise it
should return the widget containing the invalid data, and set that
widget's `:error' property to a string explaining the error.
The following predefined function can be used:
- - Function: widget-children-validate WIDGET
+ - Function: widget-children-validate widget
All the `:children' of WIDGET must be valid.
`:tab-order'
The following extra properties are recognized.
`:size'
- The width of the editable field.
- By default the field will reach to the end of the line.
+ The minimum width of the editable field.
+ By default the field will reach to the end of the line. If the
+ content is too large, the displayed representation will expand to
+ contain it. The content is not truncated to size.
`:value-face'
Face used for highlighting the editable field. Default is
`:keymap'
Keymap used in the editable field. The default value is
`widget-field-keymap', which allows you to use all the normal
- editing commands, even if the buffers major mode suppress some of
+ editing commands, even if the buffer's major mode suppress some of
them. Pressing return invokes the function specified by `:action'.
\1f
widget after it has been created with the function
`widget-radio-add-item'.
- - Function: widget-radio-add-item WIDGET TYPE
+ - Function: widget-radio-add-item widget type
Add to `radio-button-choice' widget WIDGET a new radio button item
of type TYPE.
You can examine or set the value of a widget by using the widget
object that was returned by `widget-create'.
- - Function: widget-value WIDGET
+ - Function: widget-value widget
Return the current value contained in WIDGET. It is an error to
call this function on an uninitialized widget.
- - Function: widget-value-set WIDGET VALUE
+ - Function: widget-value-set widget value
Set the value contained in WIDGET to VALUE. It is an error to
call this function with an invalid VALUE.
- *Important:* You *must* call `widget-setup' after modifying the
+ *Important:* You _must_ call `widget-setup' after modifying the
value of a widget before the user is allowed to edit the widget again.
It is enough to call `widget-setup' once if you modify multiple
widgets. This is currently only necessary if the widget contains an
can be done with `widget-put' and `widget-get'. The property names
must begin with a `:'.
- - Function: widget-put WIDGET PROPERTY VALUE
+ - Function: widget-put widget property value
In WIDGET set PROPERTY to VALUE. PROPERTY should be a symbol,
while VALUE can be anything.
- - Function: widget-get WIDGET PROPERTY
+ - Function: widget-get widget property
In WIDGET return the value for PROPERTY. PROPERTY should be a
symbol, the value is what was last set by `widget-put' for
PROPERTY.
- - Function: widget-member WIDGET PROPERTY
+ - Function: widget-member widget property
Non-nil if WIDGET has a value (even nil) for property PROPERTY.
Occasionally it can be useful to know which kind of widget you have,
i.e. the name of the widget type you gave when the widget was created.
- - Function: widget-type WIDGET
+ - Function: widget-type widget
Return the name of WIDGET, a symbol.
Widgets can be in two states: active, which means they are
specifying component widgets and new default values for the keyword
arguments.
- - Function: widget-define NAME CLASS DOC &rest ARGS
+ - Function: widget-define name class doc &rest args
Define a new widget type named NAME from `class'.
NAME and class should both be symbols, `class' should be one of
The following predefined functions can be used here:
- - Function: widget-types-convert-widget WIDGET
+ - Function: widget-types-convert-widget widget
Convert `:args' as widget types in WIDGET.
- - Function: widget-value-convert-widget WIDGET
+ - Function: widget-value-convert-widget widget
Initialize `:value' from `:args' in WIDGET.
`:value-to-internal'
The following predefined function can be used here:
- - Function: widget-children-value-delete WIDGET
+ - Function: widget-children-value-delete widget
Delete all `:children' and `:buttons' in WIDGET.
`:value-get'
The following predefined function can be used here:
- - Function: widget-value-value-get WIDGET
+ - Function: widget-value-value-get widget
Return the `:value' property of WIDGET.
`:format-handler'
The following predefined function can be used here:
- - Function: widget-parent-action WIDGET &optional EVENT
+ - Function: widget-parent-action widget &optional event
Tell `:parent' of WIDGET to handle the `:action'.
Optional EVENT is the event that triggered the action.
Utilities.
==========
- - Function: widget-prompt-value WIDGET PROMPT [ VALUE UNBOUND ]
+ - Function: widget-prompt-value widget prompt [ value unbound ]
Prompt for a value matching WIDGET, using PROMPT.
The current value is assumed to be VALUE, unless UNBOUND is
non-nil.
- - Function: widget-get-sibling WIDGET
+ - Function: widget-get-sibling widget
Get the item WIDGET is assumed to toggle.
This is only meaningful for radio buttons or checkboxes in a list.
symbol, it should pop up a menu.
+
\1f
Tag Table:
-Node: Top\7f227
-Node: Introduction\7f607
-Node: User Interface\7f4090
-Node: Programming Example\7f8985
-Node: Setting Up the Buffer\7f12302
-Node: Basic Types\7f14019
-Node: link\7f20064
-Node: url-link\7f20578
-Node: info-link\7f20890
-Node: push-button\7f21181
-Node: editable-field\7f21754
-Node: text\7f23093
-Node: menu-choice\7f23391
-Node: radio-button-choice\7f24244
-Node: item\7f25811
-Node: choice-item\7f26199
-Node: toggle\7f26697
-Node: checkbox\7f27434
-Node: checklist\7f27740
-Node: editable-list\7f29184
-Node: group\7f30366
-Node: Sexp Types\7f30653
-Node: constants\7f30966
-Node: generic\7f32045
-Node: atoms\7f32578
-Node: composite\7f34525
-Node: Widget Properties\7f36995
-Node: Defining New Widgets\7f40060
-Node: Widget Browser\7f45360
-Node: Widget Minor Mode\7f46218
-Node: Utilities\7f46775
-Node: Widget Wishlist\7f47256
+Node: Top\7f211
+Node: Introduction\7f591
+Node: User Interface\7f4075
+Node: Programming Example\7f8970
+Node: Setting Up the Buffer\7f13120
+Node: Basic Types\7f14837
+Node: link\7f20895
+Node: url-link\7f21409
+Node: info-link\7f21721
+Node: push-button\7f22012
+Node: editable-field\7f22585
+Node: text\7f24068
+Node: menu-choice\7f24366
+Node: radio-button-choice\7f25219
+Node: item\7f26786
+Node: choice-item\7f27174
+Node: toggle\7f27672
+Node: checkbox\7f28409
+Node: checklist\7f28715
+Node: editable-list\7f30159
+Node: group\7f31341
+Node: Sexp Types\7f31628
+Node: constants\7f31941
+Node: generic\7f33020
+Node: atoms\7f33553
+Node: composite\7f35500
+Node: Widget Properties\7f37970
+Node: Defining New Widgets\7f41035
+Node: Widget Browser\7f46335
+Node: Widget Minor Mode\7f47193
+Node: Utilities\7f47750
+Node: Widget Wishlist\7f48231
\1f
End Tag Table