File: README

package info (click to toggle)
rep-gtk 0.15-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 728 kB
  • ctags: 349
  • sloc: ansic: 3,577; sh: 2,430; lisp: 1,102; makefile: 159
file content (110 lines) | stat: -rw-r--r-- 3,222 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
-*- text -*-

This is rep-gtk 0.0, a binding of GTK+/GNOME/libglade for the rep Lisp
system. It is based on Marius Vollmer's guile-gtk binding (initially
version 0.15, updated to 0.17), with a new glue-code generator.

For more details see:

	http://rep-gtk.sourceforge.net/

Browse the CVS history at:

	http://tizer.dcs.warwick.ac.uk:8080/cgi-bin/cvsweb/rep-gtk


Installation
============

Basically, `./configure ; make ; make install'. If you're building from
the CVS repository, execute `aclocal ; autoconf' first.

Currently it only works with GTK 1.2.


Usage
=====

Do `(require 'gui.gtk.gtk)' to load the library, then call functions as
in guile-gtk. The only difference is that Lisp conventions are used for
booleans, i.e. nil for #f, and non-nil for #t.

I changed the names of three functions:

	gtk-idle-add-full => gtk-idle-add
	gtk-container-foreach-full => gtk-container-foreach
	gtk-signal-set-class-function-full => gtk-signal-set-class-function


libglade
========

Also included is a binding of James Henstridge's excellent libglade
(http://www.daa.com.au/~james/gnome/)

From the libglade README file:

    This library allows you to load glade interface files in a program
    at runtime. It doesn't require GLADE to be used, but GLADE is by
    far the easiest way to create the interface files.

So you can now use GLADE with rep! Here's an example from the
examples/test-libglade script:

    (require 'gui.gtk.libglade)

    (let ((xml (or (glade-xml-new (car command-line-args))
		   (error "something bad happened"))))
      (glade-xml-signal-autoconnect xml)
      (gtk-main))

The glade-xml-new function takes a filename, and creates a widget
hierarchy. glade-xml-signal-autoconnect connects all signal handlers to
the lisp functions named in the GLADE file. You can also use the
glade-xml-signal-connect function to connect individually named
handlers. (see libglade.defs for the complete function list)


GNOME
=====

There's also now reasonably complete bindings of gnome and gnomeui.
These extra modules will get built and installed:

	gui.gnome.lib		Non-UI GNOME functions, doesn't require GTK
	gui.gnome.ui		GNOME UI widgets and utilities
	gui.gnome.canvas	GNOME Canvas widgets and utilities
	gui.gtk.gdk-pixbuf	Image loading and rendering
	gui.gnome.canvas-pixbuf	CanvasItem for displaying GdkPixbuf's

see the .defs files for the gruesome details about what goes in what.
The dependence tree is something like:

			   gdk-pixbuf
			 /
	types -+- gtk -+- libglade
		     \	 \
		      \	   ui -+- canvas
		       \	\
			 lib	  canvas-pixbuf

gui.gtk.types provides conversions for the basic C types (and GLIB's
GList and GSList types).

When `gui.gnome.ui' is loaded the gnome-init function is called
automatically. If the special variables `*gnome-app-id*' and
`*gnome-app-version*' are bound to strings, then these values will be
used, otherwise something will be fabricated.

However, if using `gui.gnome.lib' without `gui.gnome.ui', you should
call `gnomelib-init' manually.

To use libglade with the GNOME widgets, load the `gui.gnome.libglade'
module instead of `gui.gtk.libglade'


Caveats
=======

It's still too easy to crash the Lisp interpreter through invalid use
of GTK..