1 | -*- text -*- |
---|
2 | |
---|
3 | This is rep-gtk 0.0, a binding of GTK+/GNOME/libglade for the rep Lisp |
---|
4 | system. It is based on Marius Vollmer's guile-gtk binding (initially |
---|
5 | version 0.15, updated to 0.17), with a new glue-code generator. |
---|
6 | |
---|
7 | For more details see: |
---|
8 | |
---|
9 | http://rep-gtk.sourceforge.net/ |
---|
10 | |
---|
11 | Browse the CVS history at: |
---|
12 | |
---|
13 | http://tizer.dcs.warwick.ac.uk:8080/cgi-bin/cvsweb/rep-gtk |
---|
14 | |
---|
15 | |
---|
16 | Installation |
---|
17 | ============ |
---|
18 | |
---|
19 | Basically, `./configure ; make ; make install'. If you're building from |
---|
20 | the CVS repository, execute `aclocal ; autoconf' first. |
---|
21 | |
---|
22 | Currently it only works with GTK 1.2. |
---|
23 | |
---|
24 | |
---|
25 | Usage |
---|
26 | ===== |
---|
27 | |
---|
28 | Do `(require 'gui.gtk.gtk)' to load the library, then call functions as |
---|
29 | in guile-gtk. The only difference is that Lisp conventions are used for |
---|
30 | booleans, i.e. nil for #f, and non-nil for #t. |
---|
31 | |
---|
32 | I changed the names of three functions: |
---|
33 | |
---|
34 | gtk-idle-add-full => gtk-idle-add |
---|
35 | gtk-container-foreach-full => gtk-container-foreach |
---|
36 | gtk-signal-set-class-function-full => gtk-signal-set-class-function |
---|
37 | |
---|
38 | |
---|
39 | libglade |
---|
40 | ======== |
---|
41 | |
---|
42 | Also included is a binding of James Henstridge's excellent libglade |
---|
43 | (http://www.daa.com.au/~james/gnome/) |
---|
44 | |
---|
45 | From the libglade README file: |
---|
46 | |
---|
47 | This library allows you to load glade interface files in a program |
---|
48 | at runtime. It doesn't require GLADE to be used, but GLADE is by |
---|
49 | far the easiest way to create the interface files. |
---|
50 | |
---|
51 | So you can now use GLADE with rep! Here's an example from the |
---|
52 | examples/test-libglade script: |
---|
53 | |
---|
54 | (require 'gui.gtk.libglade) |
---|
55 | |
---|
56 | (let ((xml (or (glade-xml-new (car command-line-args)) |
---|
57 | (error "something bad happened")))) |
---|
58 | (glade-xml-signal-autoconnect xml) |
---|
59 | (gtk-main)) |
---|
60 | |
---|
61 | The glade-xml-new function takes a filename, and creates a widget |
---|
62 | hierarchy. glade-xml-signal-autoconnect connects all signal handlers to |
---|
63 | the lisp functions named in the GLADE file. You can also use the |
---|
64 | glade-xml-signal-connect function to connect individually named |
---|
65 | handlers. (see libglade.defs for the complete function list) |
---|
66 | |
---|
67 | |
---|
68 | GNOME |
---|
69 | ===== |
---|
70 | |
---|
71 | There's also now reasonably complete bindings of gnome and gnomeui. |
---|
72 | These extra modules will get built and installed: |
---|
73 | |
---|
74 | gui.gnome.lib Non-UI GNOME functions, doesn't require GTK |
---|
75 | gui.gnome.ui GNOME UI widgets and utilities |
---|
76 | gui.gnome.canvas GNOME Canvas widgets and utilities |
---|
77 | gui.gtk.gdk-pixbuf Image loading and rendering |
---|
78 | gui.gnome.canvas-pixbuf CanvasItem for displaying GdkPixbuf's |
---|
79 | |
---|
80 | see the .defs files for the gruesome details about what goes in what. |
---|
81 | The dependence tree is something like: |
---|
82 | |
---|
83 | gdk-pixbuf |
---|
84 | / |
---|
85 | types -+- gtk -+- libglade |
---|
86 | \ \ |
---|
87 | \ ui -+- canvas |
---|
88 | \ \ |
---|
89 | lib canvas-pixbuf |
---|
90 | |
---|
91 | gui.gtk.types provides conversions for the basic C types (and GLIB's |
---|
92 | GList and GSList types). |
---|
93 | |
---|
94 | When `gui.gnome.ui' is loaded the gnome-init function is called |
---|
95 | automatically. If the special variables `*gnome-app-id*' and |
---|
96 | `*gnome-app-version*' are bound to strings, then these values will be |
---|
97 | used, otherwise something will be fabricated. |
---|
98 | |
---|
99 | However, if using `gui.gnome.lib' without `gui.gnome.ui', you should |
---|
100 | call `gnomelib-init' manually. |
---|
101 | |
---|
102 | To use libglade with the GNOME widgets, load the `gui.gnome.libglade' |
---|
103 | module instead of `gui.gtk.libglade' |
---|
104 | |
---|
105 | |
---|
106 | Caveats |
---|
107 | ======= |
---|
108 | |
---|
109 | It's still too easy to crash the Lisp interpreter through invalid use |
---|
110 | of GTK.. |
---|