Function: widget-toggle-value-create

widget-toggle-value-create is a byte-compiled function defined in wid-edit.el.gz.

Signature

(widget-toggle-value-create WIDGET)

Documentation

Insert text representing the on and off states.

Aliases

widget-visibility-value-create (obsolete since 29.1)

Source Code

;; Defined in /usr/src/emacs/lisp/wid-edit.el.gz
(defun widget-toggle-value-create (widget)
  "Insert text representing the `on' and `off' states."
  (let* ((val (widget-value widget))
	 (text (substitute-command-keys
		(widget-get widget (if val :on :off))))
	 (img (widget-image-find
	       (widget-get widget (if val :on-glyph :off-glyph)))))
    (widget-image-insert widget (or text "")
			 (if img
			     (append img '(:ascent center))))))