1 This package contains Common Lisp bindings to GTK+ v2.x. It currently
2 works with CMUCL 19, SBCL 0.9 and CLISP. Ports to other CL
3 implementations may be added later.
9 The most recent version of this package can be downloaded from
10 http://sourceforge.net/projects/clg.
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
19 instructions of how to add callback support, are borrowed
20 from the Common Music installation guide:
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:
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
34 ¹ A slightly modified version which works with SBCL 0.8.21 or newer
36 http://jupiter.td.org.uit.no/lisp/sbcl-0.8.21-af.tar.gz
39 2. Set up paths to match your system:
41 - Add a logical-pathname-translation to the clg root directory in
42 ~/.cmucl-init.lisp, ~/.sbclrc or some other startup file, like
46 (logical-pathname-translations "clg")
47 '(("**;*.*.*" "/home/espen/src/clg/**/")))
49 - Set the correct pkg-config search path if your Gtk+ installation
50 is in an unusual place, by adding it to the PKG_CONFIG_PATH
51 environment variable before starting lisp.
53 - Make sure ASDF finds the system definition files:
56 (translate-logical-pathname "clg:systems;")
57 asdf:*central-registry*)
60 When checking out of CVS also do the following:
62 $ mkdir systems && cd systems
63 $ find .. -name '*.asd' -exec ln -s {} . \;
66 3. Compile and load the system:
68 (asdf:oos 'asdf:load-op :gtk)
70 In CMUCL 19a this will fail with:
72 Error in function KERNEL::%REDEFINE-DEFSTRUCT:
73 Redefining class PCL::SLOT-INFO incompatibly with the current definition.
75 Just accept the redefinition (restart 1) to continue building or
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
80 If you are running SBCL with Slime you need to put the following
81 in ~/.swank.lisp to prevent Slime from spawning multiple
82 threads, since GTK+ is not really thread safe:
84 #+sbcl(setq swank:*communication-style* :fd-handler)
86 CLISP needs to be started with the option '-ansi' for clg to
90 4. If everything worked, try (load "hello-world") to see a small
91 window pop up, and then run testgtk.lisp in the example directory.
95 Guidelines for using the GTK+ API documentation
96 -----------------------------------------------
98 Here are some brief guidelines for using the GTK+ API documentation. A
99 lot of (both intentional and unintentional) inconsistencies exists,
100 so it is also wise to check the source code.
102 - library prefixes are stripped from all symbols
104 - object properties should be available as virtual slots. A lot of
105 "missing" properties are manually defined as slots. Slots may be read
106 only or write only, but there later type are generally only
107 defined automatically through introspection
109 - the get/set part are removed from regular accessors, but retained
110 in functions which set or retrieve multiple values
112 - predicate functions follow the normal convention of ending
115 - if there are multiple similar named functions which only differ in
116 the type of argument they accept, only one function accepting any
117 kind of valid argument types is provided
119 - there are no gtk_*_new functions, use MAKE-INSTANCE to create widgets
121 - use CHILD-PROPERTY-VALUE or automatically defined accessors to
122 access child properties
124 - use STYLE-PROPERTY-VALUE to access style properties
126 - the only function used to connect signals is SIGNAL-CONNECT
128 - some additional initargs to make-instance:
132 child -- adds a child to a container widget. This argument could
133 be a widget or a list who's first element is a widget and the rest
134 child properties. Multiple :child initargs may be specified
136 children -- list of children to be added
138 child-args -- default child properties used when adding children (during
141 show-children -- automatically make children (and grandchildren)
142 visible. May be overridden in a child by explicit specifying :visible or
143 another :show-children
148 stock -- equivalent to ":label stock :use-stock t :use-underline t"
153 button -- button specification applied to dialog-add-button. Multiple
154 :button initargs may be specified
156 buttons -- list of button specifications
160 Send comments and patches to clg-devel@lists.sourceforge.net or
161 espen@users.sourceforge.net.