source: trunk/third/rep-gtk/examples/clist.jl @ 18404

Revision 18404, 1.2 KB checked in by ghudson, 22 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r18403, which included commits to RCS files with non-trunk default branches.
  • Property svn:executable set to *
Line 
1#! /bin/sh
2exec rep --batch "$0" "$@"
3!#
4
5(structure ()
6
7    (open rep
8          rep.system
9          gui.gtk-2.gtk)
10
11  (define titles ["name" "uid" "gid" "passwd" "gecos" "home" "shell"])
12
13  (define window (gtk-window-new 'toplevel))
14
15  (define scrolled-window (gtk-scrolled-window-new))
16
17  (define clist (gtk-clist-new-with-titles titles))
18
19  (gtk-container-add window scrolled-window)
20  (gtk-container-add scrolled-window clist)
21  (gtk-scrolled-window-set-policy scrolled-window 'automatic 'automatic)
22  (gtk-window-set-default-size window 400 200)
23
24  (do ((i 0 (1+ i)))
25      ((= i 10))
26    (gtk-clist-append clist (vector (format nil "record-%d" i)
27                                    (format nil "field1-%d" i)
28                                    (format nil "field2-%d" i)
29                                    (format nil "field3-%d" i)
30                                    (format nil "field4-%d" i)
31                                    (format nil "field5-%d" i)
32                                    (format nil "field6-%d" i))))
33
34  (do ((i 0 (1+ i)))
35      ((= i (length titles)))
36    (gtk-clist-set-column-auto-resize clist i t))
37
38  (g-signal-connect window "delete_event" (lambda (w) (throw 'quit 0)))
39
40  (g-signal-connect clist "select_row"
41                    (lambda args
42                      (format standard-error "select: %S\n" args)))
43
44  (gtk-widget-show-all window)
45
46  (setq interrupt-mode 'exit)
47  (recursive-edit))
48
49;; Local variables:
50;; major-mode: lisp-mode
51;; End:
Note: See TracBrowser for help on using the repository browser.