comparison tests/glyph-test.el @ 388:aabb7f5b1c81 r21-2-9

Import from CVS: tag r21-2-9
author cvs
date Mon, 13 Aug 2007 11:09:42 +0200
parents bbff43aa5eb7
children 74fd4e045ea6
comparison
equal deleted inserted replaced
387:f892a9d0bb8d 388:aabb7f5b1c81
1 (set-extent-begin-glyph 1 (set-extent-begin-glyph
2 (make-extent (point) (point)) 2 (make-extent (point) (point))
3 (make-glyph [xpm :file "../etc/xemacs-icon.xpm"])) 3 (setq icon (make-glyph [xpm :file "../etc/xemacs-icon.xpm"])))
4 4
5 (defun foo () 5 (defun foo ()
6 (interactive) 6 (interactive)
7 (setq ok-select (not ok-select))) 7 (setq ok-select (not ok-select)))
8 8
18 (make-glyph [button :descriptor ["ok" (setq ok-select nil) :style radio 18 (make-glyph [button :descriptor ["ok" (setq ok-select nil) :style radio
19 :selected (not ok-select)]])) 19 :selected (not ok-select)]]))
20 ;; normal pushbutton 20 ;; normal pushbutton
21 (set-extent-begin-glyph 21 (set-extent-begin-glyph
22 (make-extent (point) (point)) 22 (make-extent (point) (point))
23 (setq pbutton (make-glyph [button :width 10 :height 2 23 (setq pbutton (make-glyph
24 :face modeline-mousable 24 [button :width 10 :height 2
25 :descriptor ["ok" foo :selected t]]))) 25 :face modeline-mousable
26 :descriptor "ok" :callback foo
27 :selected t])))
28 ;; progress gauge
29 (set-extent-begin-glyph
30 (make-extent (point) (point))
31 (setq pgauge (make-glyph
32 [progress :width 10 :height 2
33 :descriptor "ok"])))
34 ;; progress the progress ...
35 (let ((x 0))
36 (while (<= x 100)
37 (set-image-instance-property (glyph-image-instance pgauge) :percent x)
38 (setq x (+ x 5))
39 (sit-for 0.1)))
40
41 ;; progress gauge in the modeline
42 (setq global-mode-string
43 (cons (make-extent nil nil)
44 (setq pg (make-glyph
45 [progress :width 5 :pixel-height 16
46 :descriptor "ok"]))))
47 ;; progress the progress ...
48 (let ((x 0))
49 (while (<= x 100)
50 (set-image-instance-property (glyph-image-instance pg) :percent x)
51 (setq x (+ x 5))
52 (sit-for 0.1)))
53
54 (set-extent-begin-glyph
55 (make-extent (point) (point))
56 (make-glyph
57 [button :face modeline-mousable
58 :descriptor "ok" :callback foo
59 :image (make-glyph
60 [xpm :file "../etc/xemacs-icon.xpm"])]))
61
26 ;; normal pushbutton 62 ;; normal pushbutton
27 (set-extent-begin-glyph 63 (set-extent-begin-glyph
28 (make-extent (point) (point)) 64 (make-extent (point) (point))
29 (make-glyph [button :descriptor ["A Big Button" foo ]])) 65 (make-glyph [button :descriptor ["A Big Button" foo ]]))
30 ;; edit box 66 ;; edit box