comparison lisp/wid-edit.el @ 17415:30a567b89fb6

Sync with 1.84.
author Per Abrahamsen <abraham@dina.kvl.dk>
date Sat, 12 Apr 1997 17:51:31 +0000
parents 1effe507ea85
children 4d7f2035303a
comparison
equal deleted inserted replaced
17414:f967f12c8ec8 17415:30a567b89fb6
2 ;; 2 ;;
3 ;; Copyright (C) 1996, 1997 Free Software Foundation, Inc. 3 ;; Copyright (C) 1996, 1997 Free Software Foundation, Inc.
4 ;; 4 ;;
5 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk> 5 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
6 ;; Keywords: extensions 6 ;; Keywords: extensions
7 ;; Version: 1.71 7 ;; Version: 1.84
8 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/ 8 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/
9 9
10 ;;; Commentary: 10 ;;; Commentary:
11 ;; 11 ;;
12 ;; See `widget.el'. 12 ;; See `widget.el'.
1236 (defvar widget-push-button-cache nil) 1236 (defvar widget-push-button-cache nil)
1237 1237
1238 (define-widget 'push-button 'item 1238 (define-widget 'push-button 'item
1239 "A pushable button." 1239 "A pushable button."
1240 :value-create 'widget-push-button-value-create 1240 :value-create 'widget-push-button-value-create
1241 :text-format "[%s]"
1241 :format "%[%v%]") 1242 :format "%[%v%]")
1242 1243
1243 (defun widget-push-button-value-create (widget) 1244 (defun widget-push-button-value-create (widget)
1244 ;; Insert text representing the `on' and `off' states. 1245 ;; Insert text representing the `on' and `off' states.
1245 (let* ((tag (or (widget-get widget :tag) 1246 (let* ((tag (or (widget-get widget :tag)
1246 (widget-get widget :value))) 1247 (widget-get widget :value)))
1247 (text (concat "[" tag "]")) 1248 (text (format (widget-get widget :text-format) tag))
1248 (gui (cdr (assoc tag widget-push-button-cache)))) 1249 (gui (cdr (assoc tag widget-push-button-cache))))
1249 (if (and (fboundp 'make-gui-button) 1250 (if (and (fboundp 'make-gui-button)
1250 (fboundp 'make-glyph) 1251 (fboundp 'make-glyph)
1251 widget-push-button-gui 1252 widget-push-button-gui
1252 (fboundp 'device-on-window-system-p) 1253 (fboundp 'device-on-window-system-p)
2372 :value-to-external (lambda (widget value) (apply 'vector value))) 2373 :value-to-external (lambda (widget value) (apply 'vector value)))
2373 2374
2374 (defun widget-vector-match (widget value) 2375 (defun widget-vector-match (widget value)
2375 (and (vectorp value) 2376 (and (vectorp value)
2376 (widget-group-match widget 2377 (widget-group-match widget
2377 (widget-apply :value-to-internal widget value)))) 2378 (widget-apply widget :value-to-internal value))))
2378 2379
2379 (define-widget 'cons 'group 2380 (define-widget 'cons 'group
2380 "A cons-cell." 2381 "A cons-cell."
2381 :tag "Cons-cell" 2382 :tag "Cons-cell"
2382 :format "%{%t%}:\n%v" 2383 :format "%{%t%}:\n%v"