diff options
| author | Richard M. Stallman | 2001-11-27 05:04:13 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2001-11-27 05:04:13 +0000 |
| commit | 805e9a057ef635f4b16547f5c1e1fa849e341e93 (patch) | |
| tree | aeda588148dedda5affc6976df9165813645b842 | |
| parent | 5f537e54d643764193bb10baf2f1e221a1f3ffe4 (diff) | |
| download | emacs-805e9a057ef635f4b16547f5c1e1fa849e341e93.tar.gz emacs-805e9a057ef635f4b16547f5c1e1fa849e341e93.zip | |
(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.
| -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." | |||
| 1996 | (defun widget-toggle-value-create (widget) | 1996 | (defun widget-toggle-value-create (widget) |
| 1997 | "Insert text representing the `on' and `off' states." | 1997 | "Insert text representing the `on' and `off' states." |
| 1998 | (if (widget-value widget) | 1998 | (if (widget-value widget) |
| 1999 | (widget-image-insert widget | 1999 | (progn |
| 2000 | (widget-get widget :on) | 2000 | (and (display-graphic-p) |
| 2001 | (widget-get widget :on-glyph)) | 2001 | (listp (widget-get widget :on-glyph)) |
| 2002 | (widget-put widget :on-glyph | ||
| 2003 | (eval (widget-get widget :on-glyph)))) | ||
| 2004 | (widget-image-insert widget | ||
| 2005 | (widget-get widget :on) | ||
| 2006 | (widget-get widget :on-glyph))) | ||
| 2007 | (and (display-graphic-p) | ||
| 2008 | (listp (widget-get widget :off-glyph)) | ||
| 2009 | (widget-put widget :off-glyph | ||
| 2010 | (eval (widget-get widget :off-glyph)))) | ||
| 2002 | (widget-image-insert widget | 2011 | (widget-image-insert widget |
| 2003 | (widget-get widget :off) | 2012 | (widget-get widget :off) |
| 2004 | (widget-get widget :off-glyph)))) | 2013 | (widget-get widget :off-glyph)))) |
| @@ -2020,19 +2029,19 @@ when he invoked the menu." | |||
| 2020 | ;; We could probably do the same job as the images using single | 2029 | ;; We could probably do the same job as the images using single |
| 2021 | ;; space characters in a boxed face with a stretch specification to | 2030 | ;; space characters in a boxed face with a stretch specification to |
| 2022 | ;; make them square. | 2031 | ;; make them square. |
| 2023 | :on-glyph (create-image "\000\066\076\034\076\066\000" | 2032 | :on-glyph '(create-image "\000\066\076\034\076\066\000" |
| 2024 | 'xbm t :width 7 :height 7 | ||
| 2025 | :background "grey75" ; like default mode line | ||
| 2026 | :foreground "black" | ||
| 2027 | :relief -3 | ||
| 2028 | :ascent 'center) | ||
| 2029 | :off "[ ]" | ||
| 2030 | :off-glyph (create-image (make-string 7 0) | ||
| 2031 | 'xbm t :width 7 :height 7 | 2033 | 'xbm t :width 7 :height 7 |
| 2032 | :background "grey75" | 2034 | :background "grey75" ; like default mode line |
| 2033 | :foreground "black" | 2035 | :foreground "black" |
| 2034 | :relief 3 | 2036 | :relief -3 |
| 2035 | :ascent 'center) | 2037 | :ascent 'center) |
| 2038 | :off "[ ]" | ||
| 2039 | :off-glyph '(create-image (make-string 7 0) | ||
| 2040 | 'xbm t :width 7 :height 7 | ||
| 2041 | :background "grey75" | ||
| 2042 | :foreground "black" | ||
| 2043 | :relief 3 | ||
| 2044 | :ascent 'center) | ||
| 2036 | :help-echo "Toggle this item." | 2045 | :help-echo "Toggle this item." |
| 2037 | :action 'widget-checkbox-action) | 2046 | :action 'widget-checkbox-action) |
| 2038 | 2047 | ||