changeset 18369:ffdf3d404802

(group-visibility): New widget type. (widget-group-visibility-create): New function.
author Richard M. Stallman <rms@gnu.org>
date Sat, 21 Jun 1997 18:32:42 +0000
parents 14b3e7eb6a17
children 74558272517b
files lisp/wid-edit.el
diffstat 1 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/wid-edit.el	Sat Jun 21 18:23:40 1997 +0000
+++ b/lisp/wid-edit.el	Sat Jun 21 18:32:42 1997 +0000
@@ -2621,6 +2621,24 @@
 	(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'.