\input texinfo.tex
@c %**start of header
-@setfilename ../../info/widget
+@setfilename ../../info/widget.info
@settitle The Emacs Widget Library
+@include docstyle.texi
@syncodeindex fn cp
@syncodeindex vr cp
@syncodeindex ky cp
@c %**end of header
@copying
-Copyright @copyright{} 2000--2012 Free Software Foundation, Inc.
+Copyright @copyright{} 2000--2016 Free Software Foundation, Inc.
@quotation
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
-Invariant Sections, with the Front-Cover texts being ``A GNU Manual'',
+Invariant Sections, with the Front-Cover Texts being ``A GNU Manual'',
and with the Back-Cover Texts as in (a) below. A copy of the license
is included in the section entitled ``GNU Free Documentation License''.
Customization facility.
@end direntry
+
+@titlepage
+@title The Emacs Widget Library
+@page
+@vskip 0pt plus 1filll
+@insertcopying
+@end titlepage
+
@contents
@node Top
@chapter Introduction
Most graphical user interface toolkits provide a number of standard
-user interface controls (sometimes known as `widgets' or `gadgets').
+user interface controls (sometimes known as ``widgets'' or ``gadgets'').
Emacs doesn't really support anything like this, except for an
incredibly powerful text ``widget.'' On the other hand, Emacs does
provide the necessary primitives to implement many other widgets
(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))))
+ :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")
:notify (lambda (widget &rest ignore)
(message "You selected %s"
(widget-value widget)))
- '(item "One") '(item "Another One.") '(item "A Final One."))
+ '(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))
+ (if (= (length
+ (widget-value widget-example-repeat))
3)
(message "Congratulation!")
(error "Three was the count!")))
This should be called after creating all the widgets and before allowing
the user to edit them.
-@refill
@end defun
If you want to insert text outside the widgets in the form, the
@key{TAB} and @kbd{C-@key{TAB}} are bound to @code{widget-forward} and
@code{widget-backward}, respectively. @key{RET} and @kbd{Mouse-2}
are bound to @code{widget-button-press} and
-@code{widget-button-click}.@refill
+@code{widget-button-click}.
@end defvr
@defvar widget-global-map
@defun widget-prompt-value widget prompt [ value unbound ]
Prompt for a value matching @var{widget}, using @var{prompt}.
The current value is assumed to be @var{value}, unless @var{unbound} is
-non-@code{nil}.@refill
+non-@code{nil}.
@end defun
@defun widget-get-sibling widget