chiark / gitweb /
Return a more robust warning when we try to define a type with a
[clg] / README
CommitLineData
4cbcd094 1This package contains Common Lisp bindings to GTK+ v2.x. It currently
127f34b4 2works with CMUCL 19, SBCL 0.9 and CLISP. Ports to other CL
4cbcd094 3implementations may be added later.
560af5c5 4
5
6New versions
7------------
8
4cbcd094 9The most recent version of this package can be downloaded from
10http://sourceforge.net/projects/clg.
560af5c5 11
12
13
14Build instructions
15------------------
16
b56b4e4a 171. 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 392. Set up paths to match your system:
af2d02f4 40
792ab9c7 41 - Set the correct pkg-config search path if your Gtk+ installation
f00b458d 42 is in an unusual place, by adding it to the PKG_CONFIG_PATH
43 environment variable before starting lisp.
44
792ab9c7 45 - Make sure ASDF finds the system definition files:
4cbcd094 46
9fd9bb42 47 (push "/path/to/clg/systems/" asdf:*central-registry*)
127f34b4 48
4cbcd094 49
50 When checking out of CVS also do the following:
51 $ cd <clg toplevel>
52 $ mkdir systems && cd systems
53 $ find .. -name '*.asd' -exec ln -s {} . \;
f00b458d 54
55
563. Compile and load the system:
57
58 (asdf:oos 'asdf:load-op :gtk)
59
17bf3fff 60 In CMUCL 19a this will fail with:
f00b458d 61
62 Error in function KERNEL::%REDEFINE-DEFSTRUCT:
63 Redefining class PCL::SLOT-INFO incompatibly with the current definition.
64
792ab9c7 65 Just accept the redefinition (restart 1) to continue building or
305588d5 66 loading. To avoid doing this every time clg is loaded, compile
67 and load glib/pcl.lisp in newly started CMUCL process and save a
17bf3fff 68 new core image.
792ab9c7 69
70 If you are running SBCL with Slime you need to put the following
4cbcd094 71 in ~/.swank.lisp to prevent Slime from spawning multiple
72 threads, since GTK+ is not really thread safe:
792ab9c7 73
74 #+sbcl(setq swank:*communication-style* :fd-handler)
af2d02f4 75
127f34b4 76 CLISP needs to be started with the option '-ansi' for clg to
77 compile and load.
78
af2d02f4 79
804. If everything worked, try (load "hello-world") to see a small
f00b458d 81 window pop up, and then run testgtk.lisp in the example directory.
82
af2d02f4 83
af2d02f4 84
792ab9c7 85Guidelines for using the GTK+ API documentation
86-----------------------------------------------
87
88Here are some brief guidelines for using the GTK+ API documentation. A
4cbcd094 89lot of (both intentional and unintentional) inconsistencies exists,
90so it is also wise to check the source code.
792ab9c7 91
92- library prefixes are stripped from all symbols
93
ecb68777 94- object properties should be available as virtual slots. A lot of
95 "missing" properties are manually defined as slots. Slots may be read
96 only or write only, but there later type are generally only
97 defined automatically through introspection
98
792ab9c7 99- the get/set part are removed from regular accessors, but retained
100 in functions which set or retrieve multiple values
560af5c5 101
792ab9c7 102- predicate functions follow the normal convention of ending
103 with '-P'
560af5c5 104
792ab9c7 105- if there are multiple similar named functions which only differ in
106 the type of argument they accept, only one function accepting any
107 kind of valid argument types is provided
560af5c5 108
792ab9c7 109- there are no gtk_*_new functions, use MAKE-INSTANCE to create widgets
110
792ab9c7 111- use CHILD-PROPERTY-VALUE or automatically defined accessors to
112 access child properties
113
114- use STYLE-PROPERTY-VALUE to access style properties
115
116- the only function used to connect signals is SIGNAL-CONNECT
117
fcdb9e36 118- some additional initargs to make-instance:
119
120 - gtk:container
121
122 child -- adds a child to a container widget. This argument could
123 be a widget or a list who's first element is a widget and the rest
124 child properties. Multiple :child initargs may be specified
125
126 children -- list of children to be added
127
128 child-args -- default child properties used when adding children (during
129 construction only)
130
131 show-children -- automatically make children (and grandchildren)
132 visible. May be overridden in a child by explicit specifying :visible or
133 another :show-children
134
135
136 - gtk:button
137
138 stock -- equivalent to ":label stock :use-stock t :use-underline t"
139
140
141 - gtk:dialog
142
143 button -- button specification applied to dialog-add-button. Multiple
144 :button initargs may be specified
145
146 buttons -- list of button specifications
792ab9c7 147
148
149
792ab9c7 150Send comments and patches to clg-devel@lists.sourceforge.net or
151espen@users.sourceforge.net.