Mercurial > hg > xemacs-beta
diff tests/glyph-test.el @ 434:9d177e8d4150 r21-2-25
Import from CVS: tag r21-2-25
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:30:53 +0200 |
parents | 3ecd8885ac67 |
children | 84b14dcb0985 |
line wrap: on
line diff
--- a/tests/glyph-test.el Mon Aug 13 11:30:00 2007 +0200 +++ b/tests/glyph-test.el Mon Aug 13 11:30:53 2007 +0200 @@ -151,4 +151,25 @@ (set-glyph-face layout 'gui-element) (set-extent-begin-glyph (make-extent (point) (point)) layout) - + +(setq test-toggle-widget nil) + +(defun test-toggle (widget) + (set-extent-begin-glyph + (make-extent (point) (point)) + (make-glyph (vector 'button + :descriptor "ok" + :style 'toggle + :selected `(funcall test-toggle-value + ,widget) + :callback `(funcall test-toggle-action + ,widget))))) + +(defun test-toggle-action (widget &optional event) + (if widget + (message "Widget is t") + (message "Widget is nil"))) + +(defun test-toggle-value (widget) + (setq widget (not widget)) + (not widget))