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