1996 |
(defun widget-toggle-value-create (widget) |
(defun widget-toggle-value-create (widget) |
1997 |
"Insert text representing the `on' and `off' states." |
"Insert text representing the `on' and `off' states." |
1998 |
(if (widget-value widget) |
(if (widget-value widget) |
1999 |
(widget-image-insert widget |
(progn |
2000 |
(widget-get widget :on) |
(and (display-graphic-p) |
2001 |
(widget-get widget :on-glyph)) |
(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)))) |
2011 |
(widget-image-insert widget |
(widget-image-insert widget |
2012 |
(widget-get widget :off) |
(widget-get widget :off) |
2013 |
(widget-get widget :off-glyph)))) |
(widget-get widget :off-glyph)))) |
2029 |
;; We could probably do the same job as the images using single |
;; We could probably do the same job as the images using single |
2030 |
;; space characters in a boxed face with a stretch specification to |
;; space characters in a boxed face with a stretch specification to |
2031 |
;; make them square. |
;; make them square. |
2032 |
:on-glyph (create-image "\000\066\076\034\076\066\000" |
: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) |
|
2033 |
'xbm t :width 7 :height 7 |
'xbm t :width 7 :height 7 |
2034 |
:background "grey75" |
:background "grey75" ; like default mode line |
2035 |
:foreground "black" |
:foreground "black" |
2036 |
:relief 3 |
:relief -3 |
2037 |
:ascent 'center) |
: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) |
2045 |
:help-echo "Toggle this item." |
:help-echo "Toggle this item." |
2046 |
:action 'widget-checkbox-action) |
:action 'widget-checkbox-action) |
2047 |
|
|