diff options
Diffstat (limited to 'doc/misc/widget.texi')
| -rw-r--r-- | doc/misc/widget.texi | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/doc/misc/widget.texi b/doc/misc/widget.texi index fc8f3b2ea58..2d95daf36d4 100644 --- a/doc/misc/widget.texi +++ b/doc/misc/widget.texi | |||
| @@ -8,8 +8,8 @@ | |||
| 8 | @c %**end of header | 8 | @c %**end of header |
| 9 | 9 | ||
| 10 | @copying | 10 | @copying |
| 11 | Copyright @copyright{} 2000, 2001, 2002, 2003, 2004, 2005, | 11 | Copyright @copyright{} 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, |
| 12 | 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. | 12 | 2008, 2009, 2010 Free Software Foundation, Inc. |
| 13 | 13 | ||
| 14 | @quotation | 14 | @quotation |
| 15 | Permission is granted to copy, distribute and/or modify this document | 15 | Permission is granted to copy, distribute and/or modify this document |
| @@ -27,8 +27,8 @@ developing GNU and promoting software freedom.'' | |||
| 27 | 27 | ||
| 28 | @dircategory Emacs | 28 | @dircategory Emacs |
| 29 | @direntry | 29 | @direntry |
| 30 | * Widget: (widget). The "widget" package used by the Emacs Customization | 30 | * Widget: (widget). The "widget" package used by the Emacs |
| 31 | facility. | 31 | Customization facility. |
| 32 | @end direntry | 32 | @end direntry |
| 33 | 33 | ||
| 34 | @contents | 34 | @contents |
| @@ -338,71 +338,71 @@ Interface}). | |||
| 338 | (remove-overlays) | 338 | (remove-overlays) |
| 339 | (widget-insert "Here is some documentation.\n\n") | 339 | (widget-insert "Here is some documentation.\n\n") |
| 340 | (widget-create 'editable-field | 340 | (widget-create 'editable-field |
| 341 | :size 13 | 341 | :size 13 |
| 342 | :format "Name: %v " ; Text after the field! | 342 | :format "Name: %v " ; Text after the field! |
| 343 | "My Name") | 343 | "My Name") |
| 344 | (widget-create 'menu-choice | 344 | (widget-create 'menu-choice |
| 345 | :tag "Choose" | 345 | :tag "Choose" |
| 346 | :value "This" | 346 | :value "This" |
| 347 | :help-echo "Choose me, please!" | 347 | :help-echo "Choose me, please!" |
| 348 | :notify (lambda (widget &rest ignore) | 348 | :notify (lambda (widget &rest ignore) |
| 349 | (message "%s is a good choice!" | 349 | (message "%s is a good choice!" |
| 350 | (widget-value widget))) | 350 | (widget-value widget))) |
| 351 | '(item :tag "This option" :value "This") | 351 | '(item :tag "This option" :value "This") |
| 352 | '(choice-item "That option") | 352 | '(choice-item "That option") |
| 353 | '(editable-field :menu-tag "No option" "Thus option")) | 353 | '(editable-field :menu-tag "No option" "Thus option")) |
| 354 | (widget-create 'editable-field | 354 | (widget-create 'editable-field |
| 355 | :format "Address: %v" | 355 | :format "Address: %v" |
| 356 | "Some Place\nIn some City\nSome country.") | 356 | "Some Place\nIn some City\nSome country.") |
| 357 | (widget-insert "\nSee also ") | 357 | (widget-insert "\nSee also ") |
| 358 | (widget-create 'link | 358 | (widget-create 'link |
| 359 | :notify (lambda (&rest ignore) | 359 | :notify (lambda (&rest ignore) |
| 360 | (widget-value-set widget-example-repeat | 360 | (widget-value-set widget-example-repeat |
| 361 | '("En" "To" "Tre")) | 361 | '("En" "To" "Tre")) |
| 362 | (widget-setup)) | 362 | (widget-setup)) |
| 363 | "other work") | 363 | "other work") |
| 364 | (widget-insert | 364 | (widget-insert |
| 365 | " for more information.\n\nNumbers: count to three below\n") | 365 | " for more information.\n\nNumbers: count to three below\n") |
| 366 | (setq widget-example-repeat | 366 | (setq widget-example-repeat |
| 367 | (widget-create 'editable-list | 367 | (widget-create 'editable-list |
| 368 | :entry-format "%i %d %v" | 368 | :entry-format "%i %d %v" |
| 369 | :notify (lambda (widget &rest ignore) | 369 | :notify (lambda (widget &rest ignore) |
| 370 | (let ((old (widget-get widget | 370 | (let ((old (widget-get widget |
| 371 | ':example-length)) | 371 | ':example-length)) |
| 372 | (new (length (widget-value widget)))) | 372 | (new (length (widget-value widget)))) |
| 373 | (unless (eq old new) | 373 | (unless (eq old new) |
| 374 | (widget-put widget ':example-length new) | 374 | (widget-put widget ':example-length new) |
| 375 | (message "You can count to %d." new)))) | 375 | (message "You can count to %d." new)))) |
| 376 | :value '("One" "Eh, two?" "Five!") | 376 | :value '("One" "Eh, two?" "Five!") |
| 377 | '(editable-field :value "three"))) | 377 | '(editable-field :value "three"))) |
| 378 | (widget-insert "\n\nSelect multiple:\n\n") | 378 | (widget-insert "\n\nSelect multiple:\n\n") |
| 379 | (widget-create 'checkbox t) | 379 | (widget-create 'checkbox t) |
| 380 | (widget-insert " This\n") | 380 | (widget-insert " This\n") |
| 381 | (widget-create 'checkbox nil) | 381 | (widget-create 'checkbox nil) |
| 382 | (widget-insert " That\n") | 382 | (widget-insert " That\n") |
| 383 | (widget-create 'checkbox | 383 | (widget-create 'checkbox |
| 384 | :notify (lambda (&rest ignore) (message "Tickle")) | 384 | :notify (lambda (&rest ignore) (message "Tickle")) |
| 385 | t) | 385 | t) |
| 386 | (widget-insert " Thus\n\nSelect one:\n\n") | 386 | (widget-insert " Thus\n\nSelect one:\n\n") |
| 387 | (widget-create 'radio-button-choice | 387 | (widget-create 'radio-button-choice |
| 388 | :value "One" | 388 | :value "One" |
| 389 | :notify (lambda (widget &rest ignore) | 389 | :notify (lambda (widget &rest ignore) |
| 390 | (message "You selected %s" | 390 | (message "You selected %s" |
| 391 | (widget-value widget))) | 391 | (widget-value widget))) |
| 392 | '(item "One") '(item "Another One.") '(item "A Final One.")) | 392 | '(item "One") '(item "Another One.") '(item "A Final One.")) |
| 393 | (widget-insert "\n") | 393 | (widget-insert "\n") |
| 394 | (widget-create 'push-button | 394 | (widget-create 'push-button |
| 395 | :notify (lambda (&rest ignore) | 395 | :notify (lambda (&rest ignore) |
| 396 | (if (= (length (widget-value widget-example-repeat)) | 396 | (if (= (length (widget-value widget-example-repeat)) |
| 397 | 3) | 397 | 3) |
| 398 | (message "Congratulation!") | 398 | (message "Congratulation!") |
| 399 | (error "Three was the count!"))) | 399 | (error "Three was the count!"))) |
| 400 | "Apply Form") | 400 | "Apply Form") |
| 401 | (widget-insert " ") | 401 | (widget-insert " ") |
| 402 | (widget-create 'push-button | 402 | (widget-create 'push-button |
| 403 | :notify (lambda (&rest ignore) | 403 | :notify (lambda (&rest ignore) |
| 404 | (widget-example)) | 404 | (widget-example)) |
| 405 | "Reset Form") | 405 | "Reset Form") |
| 406 | (widget-insert "\n") | 406 | (widget-insert "\n") |
| 407 | (use-local-map widget-keymap) | 407 | (use-local-map widget-keymap) |
| 408 | (widget-setup)) | 408 | (widget-setup)) |