]> git.eshelyaron.com Git - emacs.git/commitdiff
(group-visibility): New widget type.
authorRichard M. Stallman <rms@gnu.org>
Sat, 21 Jun 1997 18:32:42 +0000 (18:32 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 21 Jun 1997 18:32:42 +0000 (18:32 +0000)
(widget-group-visibility-create): New function.

lisp/wid-edit.el

index 898ad25924d526f9bb2a56cdace5df64008ee149..504eda3d8bdef5b5346860bfb9f35f5138732fad 100644 (file)
@@ -2621,6 +2621,24 @@ when he invoked the menu."
        (widget-glyph-insert widget on "down" "down-pushed")
       (widget-glyph-insert widget off "right" "right-pushed"))))
 
+(define-widget 'group-visibility 'item
+  "An indicator and manipulator for hidden group contents."
+  :format "%[%v%]"
+  :create 'widget-group-visibility-create
+  :button-prefix ""
+  :button-suffix ""
+  :on "Hide"
+  :off "Show"
+  :value-create 'widget-visibility-value-create
+  :action 'widget-toggle-action
+  :match (lambda (widget value) t))
+
+(defun widget-group-visibility-create (widget)
+  (let ((visible (widget-value widget)))
+    (if visible
+       (insert "--------")))
+  (widget-default-create widget))
+
 ;;; The `documentation-link' Widget.
 ;;
 ;; This is a helper widget for `documentation-string'.