Mercurial > hg > xemacs-beta
comparison man/widget.texi @ 116:9f59509498e1 r20-1b10
Import from CVS: tag r20-1b10
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:23:06 +0200 |
parents | 8619ce7e4c50 |
children | 7d55a9ba150c |
comparison
equal
deleted
inserted
replaced
115:f109f7dabbe2 | 116:9f59509498e1 |
---|---|
1 \input texinfo.tex | 1 \input texinfo.tex |
2 | 2 |
3 @c $Id: widget.texi,v 1.9 1997/03/22 06:03:13 steve Exp $ | 3 @c $Id: widget.texi,v 1.10 1997/03/28 02:29:31 steve Exp $ |
4 | 4 |
5 @c %**start of header | 5 @c %**start of header |
6 @setfilename widget | 6 @setfilename widget |
7 @settitle The Emacs Widget Library | 7 @settitle The Emacs Widget Library |
8 @iftex | 8 @iftex |
13 | 13 |
14 @node Top, Introduction, (dir), (dir) | 14 @node Top, Introduction, (dir), (dir) |
15 @comment node-name, next, previous, up | 15 @comment node-name, next, previous, up |
16 @top The Emacs Widget Library | 16 @top The Emacs Widget Library |
17 | 17 |
18 Version: 1.65 | 18 Version: 1.68 |
19 | 19 |
20 @menu | 20 @menu |
21 * Introduction:: | 21 * Introduction:: |
22 * User Interface:: | 22 * User Interface:: |
23 * Programming Example:: | 23 * Programming Example:: |
1205 | 1205 |
1206 @defun widget-type widget | 1206 @defun widget-type widget |
1207 Return the name of @var{widget}, a symbol. | 1207 Return the name of @var{widget}, a symbol. |
1208 @end defun | 1208 @end defun |
1209 | 1209 |
1210 Widgets can be in two states: active, which means they are modifiable by | |
1211 the user, or inactive, which means they cannot be modified by the user. | |
1212 You can query or set the state with the following code: | |
1213 | |
1214 @lisp | |
1215 ;; Examine if @var{widget} is active or not. | |
1216 (if (widget-apply @var{widget} :active) | |
1217 (message "Widget is active.") | |
1218 (message "Widget is inactive.") | |
1219 | |
1220 ;; Make @var{widget} inactive. | |
1221 (widget-apply @var{widget} :deactivate) | |
1222 | |
1223 ;; Make @var{widget} active. | |
1224 (widget-apply @var{widget} :activate) | |
1225 @end lisp | |
1226 | |
1227 A widget is inactive if itself, or any of its ancestors (found by | |
1228 following the @code{:parent} link) have been deactivated. To make sure | |
1229 a widget is really active, you must therefore activate both itself, and | |
1230 all its ancestors. | |
1231 | |
1232 @lisp | |
1233 (while widget | |
1234 (widget-apply widget :activate) | |
1235 (setq widget (widget-get widget :parent))) | |
1236 @end lisp | |
1237 | |
1238 You can check if a widget has been made inactive by examining the value | |
1239 of @code{:inactive} keyword. If this is non-nil, the widget itself has | |
1240 been deactivated. This is different from using the @code{:active} | |
1241 keyword, in that the later tell you if the widget @strong{or} any of its | |
1242 ancestors have been deactivated. Do not attempt to set the | |
1243 @code{:inactive} keyword directly. Use the @code{:activate} | |
1244 @code{:deactivated} keywords instead. | |
1245 | |
1246 | |
1210 @node Defining New Widgets, Widget Wishlist., Widget Properties, Top | 1247 @node Defining New Widgets, Widget Wishlist., Widget Properties, Top |
1211 @comment node-name, next, previous, up | 1248 @comment node-name, next, previous, up |
1212 @section Defining New Widgets | 1249 @section Defining New Widgets |
1213 | 1250 |
1214 You can define specialized widgets with @code{define-widget}. It allows | 1251 You can define specialized widgets with @code{define-widget}. It allows |
1336 @item | 1373 @item |
1337 The functions used in many widgets, like | 1374 The functions used in many widgets, like |
1338 @code{widget-item-convert-widget}, should not have names that are | 1375 @code{widget-item-convert-widget}, should not have names that are |
1339 specific to the first widget where I happended to use them. | 1376 specific to the first widget where I happended to use them. |
1340 | 1377 |
1341 @item | |
1342 Unchecked items in a @code{radio-button-choice} or @code{checklist} | |
1343 should be grayed out, and the subwidgets should somehow become inactive. | |
1344 This could perhaps be implemented by binding @code{widget-inactive} to t | |
1345 when inserting the grayed out subwidget, and let the widget-specify | |
1346 functions check that variable. | |
1347 | |
1348 @item | 1378 @item |
1349 Flag to make @code{widget-move} skip a specified button. | 1379 Flag to make @code{widget-move} skip a specified button. |
1350 | 1380 |
1351 @item | 1381 @item |
1352 Document `helper' functions for defining new widgets. | 1382 Document `helper' functions for defining new widgets. |