[15285] | 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 | |
---|
[18403] | 22 | It requires Gtk+ version 2. |
---|
[15285] | 23 | |
---|
[18403] | 24 | WARNING: The libglade and GNOME bindings are currently untested and |
---|
| 25 | probably broken since the port to Gtk2, use at your own risk. |
---|
[15285] | 26 | |
---|
[18403] | 27 | |
---|
[15285] | 28 | Usage |
---|
| 29 | ===== |
---|
| 30 | |
---|
[18403] | 31 | Import the module gui.gtk-2.gtk to load the library, then call |
---|
| 32 | functions as in guile-gtk. The only difference is that Lisp conventions |
---|
| 33 | are used for booleans, i.e. nil for #f, and non-nil for #t. |
---|
[15285] | 34 | |
---|
[18403] | 35 | See the included *.defs files for the details of how the library maps |
---|
| 36 | to lisp functions. |
---|
[15285] | 37 | |
---|
| 38 | |
---|
| 39 | libglade |
---|
| 40 | ======== |
---|
| 41 | |
---|
| 42 | From the libglade README file: |
---|
| 43 | |
---|
| 44 | This library allows you to load glade interface files in a program |
---|
| 45 | at runtime. It doesn't require GLADE to be used, but GLADE is by |
---|
| 46 | far the easiest way to create the interface files. |
---|
| 47 | |
---|
| 48 | So you can now use GLADE with rep! Here's an example from the |
---|
| 49 | examples/test-libglade script: |
---|
| 50 | |
---|
[18403] | 51 | (require 'gui.gtk-2.libglade) |
---|
[15285] | 52 | |
---|
| 53 | (let ((xml (or (glade-xml-new (car command-line-args)) |
---|
| 54 | (error "something bad happened")))) |
---|
| 55 | (glade-xml-signal-autoconnect xml) |
---|
| 56 | (gtk-main)) |
---|
| 57 | |
---|
| 58 | The glade-xml-new function takes a filename, and creates a widget |
---|
| 59 | hierarchy. glade-xml-signal-autoconnect connects all signal handlers to |
---|
| 60 | the lisp functions named in the GLADE file. You can also use the |
---|
| 61 | glade-xml-signal-connect function to connect individually named |
---|
| 62 | handlers. (see libglade.defs for the complete function list) |
---|
| 63 | |
---|
| 64 | |
---|
| 65 | GNOME |
---|
| 66 | ===== |
---|
| 67 | |
---|
| 68 | There's also now reasonably complete bindings of gnome and gnomeui. |
---|
| 69 | These extra modules will get built and installed: |
---|
| 70 | |
---|
[18403] | 71 | gui.gtk-2.gnome-lib Non-UI GNOME functions, doesn't require GTK |
---|
| 72 | gui.gtk-2.gnome-ui GNOME UI widgets and utilities |
---|
| 73 | gui.gtk-2.gnome-canvas GNOME Canvas widgets and utilities |
---|
[15285] | 74 | |
---|
| 75 | see the .defs files for the gruesome details about what goes in what. |
---|
| 76 | The dependence tree is something like: |
---|
| 77 | |
---|
| 78 | types -+- gtk -+- libglade |
---|
[18403] | 79 | \ \ |
---|
| 80 | \ gnome-ui -+- gnome-canvas |
---|
| 81 | \ |
---|
| 82 | gnome-lib |
---|
[15285] | 83 | |
---|
[18403] | 84 | gui.gtk-2.types provides conversions for the basic C types (and GLIB's |
---|
[15285] | 85 | GList and GSList types). |
---|
| 86 | |
---|
[18403] | 87 | When `gui.gtk-2.gnome-ui' is loaded the gnome-init function is called |
---|
[15285] | 88 | automatically. If the special variables `*gnome-app-id*' and |
---|
| 89 | `*gnome-app-version*' are bound to strings, then these values will be |
---|
| 90 | used, otherwise something will be fabricated. |
---|
| 91 | |
---|
[18403] | 92 | However, if using `gui.gtk-2.gnome-lib' without `gui.gtk-2.gnome-ui', |
---|
| 93 | you should call `gnomelib-init' manually. |
---|
[15285] | 94 | |
---|
| 95 | |
---|
| 96 | Caveats |
---|
| 97 | ======= |
---|
| 98 | |
---|
| 99 | It's still too easy to crash the Lisp interpreter through invalid use |
---|
| 100 | of GTK.. |
---|
[18403] | 101 | |
---|