chiark / gitweb /
Changes necessary to allow saving of core images with clg.
[clg] / README
1 This package contains Common Lisp bindings to GTK+ v2.0. It currently
2 only works with CMUCL 19a and SBCL. Ports to other CL implementations
3 may be added later.
4
5
6 New versions
7 ------------
8
9 The most recent version of this package can be found: in CVS 
10
11
12
13 Build instructions
14 ------------------
15
16 1. When building for SBCL (at least 0.8.19 or earlier) you first need
17    to add callback support, since SBCL does not yet has a native
18    callback facility. The following instructions are borrowed from the
19    Common Music installation guide:
20
21    1. Download Thomas Burdick's Alien Function package¹ and restore it 
22       to a directory on your machine.
23    2. Compile the Alien Function package and save a new sbcl.core image:
24
25       $ cd sbcl-af
26       $ sbcl --load "system"
27       * (sb-ext:save-lisp-and-die "/tmp/sbcl.core")
28       $ cd /usr/local/lib/sbcl
29       $ cp sbcl.core sbcl.core.orig
30       $ mv /tmp/sbcl.core .
31
32
33    ¹ http://pinhead.music.uiuc.edu/~hkt/sbcl-af-2004-10-22.tgz
34
35
36 2. Set up paths to reflect your system:
37
38    - Add a logical-pathname-translation to the clg root directory in
39      ~/.cmucl-init.lisp, ~/.sbclrc or some other startup file. Example:
40
41        (setf
42          (logical-pathname-translations "clg")
43          '(("**;*.*.*" "/home/espen/src/clg/**/")))
44
45    - Set the correct pkg-config search path if your Gtk+ installation
46      is in an unusual place, by adding it to the PKG_CONFIG_PATH
47      environment variable before starting lisp.
48
49    - Make sure ASDF finds the system definition files:
50      $ cd ~/.clc/systems
51      $ find <path to clg> -name '*.asd' -exec ln -s {} . \;
52
53
54 3. Compile and load the system:
55    
56      (asdf:oos 'asdf:load-op :gtk)
57
58    In CMUCL this will currently fail with:
59
60    Error in function KERNEL::%REDEFINE-DEFSTRUCT:
61      Redefining class PCL::SLOT-INFO incompatibly with the current definition.
62
63    Just accept the redefinition (restart 1) to continue building or
64    loading. To avoid doing this every time clg is loaded, one may
65    compile and load glib/pcl.lisp in newly started CMUCL process and
66    save an new core image.
67
68    If you are running SBCL with Slime you need to put the following
69    line in ~/.swank.lisp to prevent Slime from spawning multiple
70    threads, since Gtk+ is not thread safe:
71
72      #+sbcl(setq swank:*communication-style* :fd-handler)
73
74
75 4. If everything worked, try (load "hello-world") to see a small
76    window pop up, and then run testgtk.lisp in the example directory.
77
78
79
80 Guidelines for using the GTK+ API documentation 
81 -----------------------------------------------
82
83 Here are some brief guidelines for using the GTK+ API documentation. A
84 lot of (both intentionally and unintentionally) inconsistencies
85 exists, so it is also wise to check the source code.
86
87 - library prefixes are stripped from all symbols
88
89 - the get/set part are removed from regular accessors, but retained
90   in functions which set or retrieve multiple values
91
92 - predicate functions follow the normal convention of ending
93   with '-P'
94
95 - if there are multiple similar named functions which only differ in
96   the type of argument they accept, only one function accepting any
97   kind of valid argument types is provided
98
99 - there are no gtk_*_new functions, use MAKE-INSTANCE to create widgets
100
101 - all object properties are available as virtual slots. A lot of
102   "missing" properties are manually defined as slots
103
104 - use CHILD-PROPERTY-VALUE or automatically defined accessors to
105   access child properties
106
107 - use STYLE-PROPERTY-VALUE to access style properties
108
109 - the only function used to connect signals is SIGNAL-CONNECT
110
111
112
113
114
115 Send comments and patches to clg-devel@lists.sourceforge.net or
116 espen@users.sourceforge.net.