384
|
1 (set-extent-begin-glyph
|
|
2 (make-extent (point) (point))
|
412
|
3 (setq icon (make-glyph [xpm :file "../etc/xemacs-icon.xpm"])))
|
384
|
4
|
|
5 (defun foo ()
|
412
|
6 (interactive)
|
384
|
7 (setq ok-select (not ok-select)))
|
|
8
|
|
9 ;; button in a group
|
|
10 (setq ok-select nil)
|
|
11 (set-extent-begin-glyph
|
|
12 (make-extent (point) (point))
|
412
|
13 (make-glyph [button :descriptor ["ok " (setq ok-select t)
|
|
14 :style radio :selected ok-select]]))
|
384
|
15 ;; button in a group
|
|
16 (set-extent-begin-glyph
|
|
17 (make-extent (point) (point))
|
412
|
18 (make-glyph [button :descriptor ["ok" (setq ok-select nil) :style radio
|
|
19 :selected (not ok-select)]]))
|
384
|
20 ;; normal pushbutton
|
|
21 (set-extent-begin-glyph
|
|
22 (make-extent (point) (point))
|
412
|
23 (setq pbutton (make-glyph
|
|
24 [button :width 10 :height 2
|
|
25 :face modeline-mousable
|
|
26 :descriptor "ok" :callback foo
|
|
27 :selected t])))
|
418
|
28
|
|
29 ;; tree view
|
|
30 (set-extent-begin-glyph
|
|
31 (make-extent (point) (point))
|
|
32 (setq tree (make-glyph
|
|
33 [tree :width 10
|
|
34 :descriptor "My Tree"
|
|
35 :properties (:items (["One" foo]
|
|
36 (["Two" foo]
|
|
37 ["Four" foo]
|
|
38 "Six")
|
|
39 "Three"))])))
|
|
40
|
|
41 ;; tab control
|
|
42 (set-extent-begin-glyph
|
|
43 (make-extent (point) (point))
|
|
44 (setq tab (make-glyph
|
|
45 [tab :descriptor "My Tab"
|
|
46 :face default
|
|
47 :properties (:items (["One" foo]
|
|
48 ["Two" foo]
|
|
49 ["Three" foo]))])))
|
|
50
|
388
|
51 ;; progress gauge
|
|
52 (set-extent-begin-glyph
|
|
53 (make-extent (point) (point))
|
|
54 (setq pgauge (make-glyph
|
412
|
55 [progress :width 10 :height 2
|
|
56 :descriptor "ok"])))
|
388
|
57 ;; progress the progress ...
|
|
58 (let ((x 0))
|
|
59 (while (<= x 100)
|
412
|
60 (set-image-instance-property (glyph-image-instance pgauge) :percent x)
|
388
|
61 (setq x (+ x 5))
|
|
62 (sit-for 0.1)))
|
|
63
|
|
64 ;; progress gauge in the modeline
|
|
65 (setq global-mode-string
|
|
66 (cons (make-extent nil nil)
|
|
67 (setq pg (make-glyph
|
412
|
68 [progress :width 5 :pixel-height 16
|
|
69 :descriptor "ok"]))))
|
388
|
70 ;; progress the progress ...
|
|
71 (let ((x 0))
|
|
72 (while (<= x 100)
|
412
|
73 (set-image-instance-property (glyph-image-instance pg) :percent x)
|
388
|
74 (setq x (+ x 5))
|
|
75 (sit-for 0.1)))
|
|
76
|
|
77 (set-extent-begin-glyph
|
|
78 (make-extent (point) (point))
|
|
79 (make-glyph
|
|
80 [button :face modeline-mousable
|
|
81 :descriptor "ok" :callback foo
|
412
|
82 :image (make-glyph
|
|
83 [xpm :file "../etc/xemacs-icon.xpm"])]))
|
388
|
84
|
384
|
85 ;; normal pushbutton
|
|
86 (set-extent-begin-glyph
|
|
87 (make-extent (point) (point))
|
412
|
88 (make-glyph [button :descriptor ["A Big Button" foo ]]))
|
418
|
89
|
384
|
90 ;; edit box
|
|
91 (set-extent-begin-glyph
|
|
92 (make-extent (point) (point))
|
412
|
93 (setq hedit (make-glyph [edit :pixel-width 50 :pixel-height 30
|
|
94 :face bold-italic
|
|
95 :descriptor ["Hello"]])))
|
384
|
96 ;; combo box
|
|
97 (set-extent-begin-glyph
|
|
98 (make-extent (point) (point))
|
412
|
99 (setq hcombo (make-glyph
|
|
100 [combo :width 10 :height 3 :descriptor ["Hello"]
|
|
101 :properties (:items ("One" "Two" "Three"))])))
|
384
|
102
|
412
|
103 ;; line
|
384
|
104 (set-extent-begin-glyph
|
|
105 (make-extent (point) (point))
|
412
|
106 (make-glyph [label :pixel-width 150 :descriptor "Hello"]))
|
384
|
107
|
|
108 ;; scrollbar
|
|
109 ;(set-extent-begin-glyph
|
|
110 ; (make-extent (point) (point))
|
|
111 ; (make-glyph [scrollbar :width 50 :height 20 :descriptor ["Hello"]]))
|
|
112
|
|
113 ;; generic subwindow
|
412
|
114 (setq sw (make-glyph [subwindow :pixel-width 50 :pixel-height 50]))
|
384
|
115 (set-extent-begin-glyph (make-extent (point) (point)) sw)
|
|
116
|