diff options
author | Richard M. Stallman <rms@gnu.org> | 2001-11-27 05:04:13 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 2001-11-27 05:04:13 +0000 |
commit | 805e9a057ef635f4b16547f5c1e1fa849e341e93 (patch) | |
tree | aeda588148dedda5affc6976df9165813645b842 /lisp/wid-edit.el | |
parent | 5f537e54d643764193bb10baf2f1e221a1f3ffe4 (diff) | |
download | emacs-805e9a057ef635f4b16547f5c1e1fa849e341e93.tar.gz |
(widget-toggle-value-create): On graphic terminal,
if :on-glyph or :off-glyph is a list, eval it and store it back.
(checkbox): Quote the values for :on-glyph and :off-glyph.
Diffstat (limited to 'lisp/wid-edit.el')
-rw-r--r-- | lisp/wid-edit.el | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index a6a64f59944..a5cd1dba523 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -1996,9 +1996,18 @@ when he invoked the menu." (defun widget-toggle-value-create (widget) "Insert text representing the `on' and `off' states." (if (widget-value widget) - (widget-image-insert widget - (widget-get widget :on) - (widget-get widget :on-glyph)) + (progn + (and (display-graphic-p) + (listp (widget-get widget :on-glyph)) + (widget-put widget :on-glyph + (eval (widget-get widget :on-glyph)))) + (widget-image-insert widget + (widget-get widget :on) + (widget-get widget :on-glyph))) + (and (display-graphic-p) + (listp (widget-get widget :off-glyph)) + (widget-put widget :off-glyph + (eval (widget-get widget :off-glyph)))) (widget-image-insert widget (widget-get widget :off) (widget-get widget :off-glyph)))) @@ -2020,19 +2029,19 @@ when he invoked the menu." ;; We could probably do the same job as the images using single ;; space characters in a boxed face with a stretch specification to ;; make them square. - :on-glyph (create-image "\000\066\076\034\076\066\000" - 'xbm t :width 7 :height 7 - :background "grey75" ; like default mode line - :foreground "black" - :relief -3 - :ascent 'center) - :off "[ ]" - :off-glyph (create-image (make-string 7 0) + :on-glyph '(create-image "\000\066\076\034\076\066\000" 'xbm t :width 7 :height 7 - :background "grey75" + :background "grey75" ; like default mode line :foreground "black" - :relief 3 + :relief -3 :ascent 'center) + :off "[ ]" + :off-glyph '(create-image (make-string 7 0) + 'xbm t :width 7 :height 7 + :background "grey75" + :foreground "black" + :relief 3 + :ascent 'center) :help-echo "Toggle this item." :action 'widget-checkbox-action) |