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