comparison man/widget.texi @ 1183:c1553814932e

[xemacs-hg @ 2003-01-03 12:12:30 by stephent] various docs <873coa5unb.fsf@tleepslib.sk.tsukuba.ac.jp> <87r8bu4emz.fsf@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Fri, 03 Jan 2003 12:12:40 +0000
parents 47c30044fc4e
children ffa6c90799b1
comparison
equal deleted inserted replaced
1182:7d696106ffe9 1183:c1553814932e
31 * Defining New Widgets:: 31 * Defining New Widgets::
32 * Widget Browser:: 32 * Widget Browser::
33 * Widget Minor Mode:: 33 * Widget Minor Mode::
34 * Utilities:: 34 * Utilities::
35 * Widget Wishlist:: 35 * Widget Wishlist::
36 * Widget Internals::
36 @end menu 37 @end menu
37 38
38 @node Introduction, User Interface, Top, Top 39 @node Introduction, User Interface, Top, Top
39 @comment node-name, next, previous, up 40 @comment node-name, next, previous, up
40 @section Introduction 41 @section Introduction
118 create any widgets, the code has been split in two files: 119 create any widgets, the code has been split in two files:
119 120
120 @table @file 121 @table @file
121 @item widget.el 122 @item widget.el
122 This will declare the user variables, define the function 123 This will declare the user variables, define the function
123 @code{widget-define}, and autoload the function @code{widget-create}. 124 @code{define-widget}, and autoload the function @code{widget-create}.
124 @item wid-edit.el 125 @item wid-edit.el
125 Everything else is here, there is no reason to load it explicitly, as 126 Everything else is here, there is no reason to load it explicitly, as
126 it will be autoloaded when needed. 127 it will be autoloaded when needed.
127 @end table 128 @end table
128 129
1357 You can define specialized widgets with @code{define-widget}. It allows 1358 You can define specialized widgets with @code{define-widget}. It allows
1358 you to create a shorthand for more complex widgets. This includes 1359 you to create a shorthand for more complex widgets. This includes
1359 specifying component widgets and new default values for the keyword 1360 specifying component widgets and new default values for the keyword
1360 arguments. 1361 arguments.
1361 1362
1362 @defun widget-define name class doc &rest args 1363 @defun define-widget name class doc &rest args
1363 Define a new widget type named @var{name} from @code{class}. 1364 Define a new widget type named @var{name} from @code{class}.
1364 1365
1365 @var{name} and class should both be symbols, @code{class} should be one 1366 @var{name} and class should both be symbols, @code{class} should be one
1366 of the existing widget types. 1367 of the existing widget types.
1367 1368
1382 @end lisp 1383 @end lisp
1383 @end itemize 1384 @end itemize
1384 1385
1385 @end defun 1386 @end defun
1386 1387
1387 Using @code{widget-define} just stores the definition of the widget type 1388 Using @code{define-widget} just stores the definition of the widget type
1388 in the @code{widget-type} property of @var{name}, which is what 1389 in the @code{widget-type} property of @var{name}, which is what
1389 @code{widget-create} uses. 1390 @code{widget-create} uses.
1390 1391
1391 If you just want to specify defaults for keywords with no complex 1392 If you just want to specify defaults for keywords with no complex
1392 conversions, you can use @code{identity} as your conversion function. 1393 conversions, you can use @code{identity} as your conversion function.
1556 @defun widget-get-sibling widget 1557 @defun widget-get-sibling widget
1557 Get the item @var{widget} is assumed to toggle.@* 1558 Get the item @var{widget} is assumed to toggle.@*
1558 This is only meaningful for radio buttons or checkboxes in a list. 1559 This is only meaningful for radio buttons or checkboxes in a list.
1559 @end defun 1560 @end defun
1560 1561
1561 @node Widget Wishlist, , Utilities, Top 1562 @node Widget Wishlist, Widget Internals, Utilities, Top
1562 @comment node-name, next, previous, up 1563 @comment node-name, next, previous, up
1563 @section Wishlist 1564 @section Wishlist
1564 1565
1565 @itemize @bullet 1566 @itemize @bullet
1566 @item 1567 @item
1618 @item 1619 @item
1619 @kbd{C-e e} in a fixed size field should go to the end of the text in 1620 @kbd{C-e e} in a fixed size field should go to the end of the text in
1620 the field, not the end of the field itself. 1621 the field, not the end of the field itself.
1621 1622
1622 @item 1623 @item
1623 Use and overlay instead of markers to delimit the widget. Create 1624 Use an overlay instead of markers to delimit the widget. Create
1624 accessors for the end points. 1625 accessors for the end points.
1625 1626
1626 @item 1627 @item
1627 Clicking on documentation links should call @code{describe-function} or 1628 Clicking on documentation links should call @code{describe-function} or
1628 @code{widget-browse-other-window} and friends directly, instead of going 1629 @code{widget-browse-other-window} and friends directly, instead of going
1629 through @code{apropos}. If more than one function is valid for the 1630 through @code{apropos}. If more than one function is valid for the
1630 symbol, it should pop up a menu. 1631 symbol, it should pop up a menu.
1631 1632
1632 @end itemize 1633 @end itemize
1633 1634
1635 @node Widget Internals, , Widget Wishlist, Top
1636 @section Internals
1637
1638 This (very brief!) section provides a few notes on the internal
1639 structure and implementation of Emacs widgets. Avoid relying on this
1640 information. (We intend to improve it, but this will take some time.)
1641 To the extent that it actually describes APIs, the information will be
1642 moved to appropriate sections of the manual in due course.
1643
1644 @subsection The @dfn{Widget} and @dfn{Type} Structures
1645
1646 Widgets and types are currently both implemented as lists.
1647
1648 A symbol may be defined as a @dfn{type name} using @code{define-widget}.
1649 @xref{Defining New Widgets}. A @dfn{type} is a list whose car is a
1650 previously defined type name, nil, or (recursively) a type. The car is
1651 the @dfn{class} or parent type of the type, and properties which are not
1652 specified in the new type will be inherited from ancestors. Probably
1653 the only type without a class should be the @code{default} type. The
1654 cdr of a type is a plist whose keys are widget property keywords.
1655
1656 A type or type name may also be referred to as an @dfn{unconverted
1657 widget}.
1658
1659 A @dfn{converted widget} or @dfn{widget instance} is a list whose car is
1660 a type name or a type, and whose cdr is a property list. Furthermore,
1661 all children of the converted widget must be converted. Finally, in the
1662 process of appropriate parts of the list structure are copied to ensure
1663 that changes in values of one instance do not affect another's.
1664
1634 @contents 1665 @contents
1635 @bye 1666 @bye