File: gtk_tut.html

package info (click to toggle)
gtk%2B1.2 1.2.10-18
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 14,468 kB
  • ctags: 12,966
  • sloc: ansic: 137,190; sh: 13,303; makefile: 1,170; perl: 328; awk: 274; lisp: 7
file content (324 lines) | stat: -rw-r--r-- 13,040 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
 <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
 <TITLE>GTK v1.2 Tutorial</TITLE>
 <LINK HREF="gtk_tut-1.html" REL=next>


</HEAD>
<BODY BGCOLOR="#FFFFFF">
<A HREF="gtk_tut-1.html">Next</A>
Previous
Contents
<HR NOSHADE>
<H1>GTK v1.2 Tutorial</H1>

<H2>Tony Gale <CODE>
<A HREF="mailto:gale@gtk.org">&lt;gale@gtk.org&gt;</A></CODE>,
Ian Main <CODE>
<A HREF="mailto:imain@gtk.org">&lt;imain@gtk.org&gt;</A></CODE></H2>February 23rd, 2000
<P><HR NOSHADE>
<EM>This is a tutorial on how to use GTK (the GIMP Toolkit) through its C
interface.</EM>
<HR NOSHADE>
<P>
<H2><A NAME="toc1">1.</A> <A HREF="gtk_tut-1.html">Introduction</A></H2>

<P>
<H2><A NAME="toc2">2.</A> <A HREF="gtk_tut-2.html">Getting Started</A></H2>

<UL>
<LI><A HREF="gtk_tut-2.html#ss2.1">2.1 Hello World in GTK</A>
<LI><A HREF="gtk_tut-2.html#ss2.2">2.2 Compiling Hello World </A>
<LI><A HREF="gtk_tut-2.html#ss2.3">2.3 Theory of Signals and Callbacks</A>
<LI><A HREF="gtk_tut-2.html#ss2.4">2.4 Events</A>
<LI><A HREF="gtk_tut-2.html#ss2.5">2.5 Stepping Through Hello World</A>
</UL>
<P>
<H2><A NAME="toc3">3.</A> <A HREF="gtk_tut-3.html">Moving On</A></H2>

<UL>
<LI><A HREF="gtk_tut-3.html#ss3.1">3.1 Data Types</A>
<LI><A HREF="gtk_tut-3.html#ss3.2">3.2 More on Signal Handlers</A>
<LI><A HREF="gtk_tut-3.html#ss3.3">3.3 An Upgraded Hello World</A>
</UL>
<P>
<H2><A NAME="toc4">4.</A> <A HREF="gtk_tut-4.html">Packing Widgets </A></H2>

<UL>
<LI><A HREF="gtk_tut-4.html#ss4.1">4.1 Theory of Packing Boxes</A>
<LI><A HREF="gtk_tut-4.html#ss4.2">4.2 Details of Boxes</A>
<LI><A HREF="gtk_tut-4.html#ss4.3">4.3 Packing Demonstration Program</A>
<LI><A HREF="gtk_tut-4.html#ss4.4">4.4 Packing Using Tables</A>
<LI><A HREF="gtk_tut-4.html#ss4.5">4.5 Table Packing Example</A>
</UL>
<P>
<H2><A NAME="toc5">5.</A> <A HREF="gtk_tut-5.html">Widget Overview</A></H2>

<UL>
<LI><A HREF="gtk_tut-5.html#ss5.1">5.1 Casting</A>
<LI><A HREF="gtk_tut-5.html#ss5.2">5.2 Widget Hierarchy</A>
<LI><A HREF="gtk_tut-5.html#ss5.3">5.3 Widgets Without Windows</A>
</UL>
<P>
<H2><A NAME="toc6">6.</A> <A HREF="gtk_tut-6.html">The Button Widget</A></H2>

<UL>
<LI><A HREF="gtk_tut-6.html#ss6.1">6.1 Normal Buttons</A>
<LI><A HREF="gtk_tut-6.html#ss6.2">6.2 Toggle Buttons</A>
<LI><A HREF="gtk_tut-6.html#ss6.3">6.3 Check Buttons</A>
<LI><A HREF="gtk_tut-6.html#ss6.4">6.4 Radio Buttons </A>
</UL>
<P>
<H2><A NAME="toc7">7.</A> <A HREF="gtk_tut-7.html">Adjustments </A></H2>

<UL>
<LI><A HREF="gtk_tut-7.html#ss7.1">7.1 Creating an Adjustment</A>
<LI><A HREF="gtk_tut-7.html#ss7.2">7.2 Using Adjustments the Easy Way</A>
<LI><A HREF="gtk_tut-7.html#ss7.3">7.3 Adjustment Internals</A>
</UL>
<P>
<H2><A NAME="toc8">8.</A> <A HREF="gtk_tut-8.html">Range Widgets</A></H2>

<UL>
<LI><A HREF="gtk_tut-8.html#ss8.1">8.1 Scrollbar Widgets</A>
<LI><A HREF="gtk_tut-8.html#ss8.2">8.2 Scale Widgets</A>
<LI><A HREF="gtk_tut-8.html#ss8.3">8.3 Common Range Functions </A>
<LI><A HREF="gtk_tut-8.html#ss8.4">8.4 Key and Mouse bindings</A>
<LI><A HREF="gtk_tut-8.html#ss8.5">8.5 Example</A>
</UL>
<P>
<H2><A NAME="toc9">9.</A> <A HREF="gtk_tut-9.html">Miscellaneous Widgets</A></H2>

<UL>
<LI><A HREF="gtk_tut-9.html#ss9.1">9.1 Labels</A>
<LI><A HREF="gtk_tut-9.html#ss9.2">9.2 Arrows</A>
<LI><A HREF="gtk_tut-9.html#ss9.3">9.3 The Tooltips Object</A>
<LI><A HREF="gtk_tut-9.html#ss9.4">9.4 Progress Bars </A>
<LI><A HREF="gtk_tut-9.html#ss9.5">9.5 Dialogs</A>
<LI><A HREF="gtk_tut-9.html#ss9.6">9.6 Pixmaps </A>
<LI><A HREF="gtk_tut-9.html#ss9.7">9.7 Rulers</A>
<LI><A HREF="gtk_tut-9.html#ss9.8">9.8 Statusbars</A>
<LI><A HREF="gtk_tut-9.html#ss9.9">9.9 Text Entries</A>
<LI><A HREF="gtk_tut-9.html#ss9.10">9.10 Spin Buttons</A>
<LI><A HREF="gtk_tut-9.html#ss9.11">9.11 Combo Box</A>
<LI><A HREF="gtk_tut-9.html#ss9.12">9.12 Calendar</A>
<LI><A HREF="gtk_tut-9.html#ss9.13">9.13 Color Selection</A>
<LI><A HREF="gtk_tut-9.html#ss9.14">9.14 File Selections</A>
</UL>
<P>
<H2><A NAME="toc10">10.</A> <A HREF="gtk_tut-10.html">Container Widgets</A></H2>

<UL>
<LI><A HREF="gtk_tut-10.html#ss10.1">10.1 The EventBox </A>
<LI><A HREF="gtk_tut-10.html#ss10.2">10.2 The Alignment widget </A>
<LI><A HREF="gtk_tut-10.html#ss10.3">10.3 Fixed Container</A>
<LI><A HREF="gtk_tut-10.html#ss10.4">10.4 Layout Container</A>
<LI><A HREF="gtk_tut-10.html#ss10.5">10.5 Frames </A>
<LI><A HREF="gtk_tut-10.html#ss10.6">10.6 Aspect Frames</A>
<LI><A HREF="gtk_tut-10.html#ss10.7">10.7 Paned Window Widgets</A>
<LI><A HREF="gtk_tut-10.html#ss10.8">10.8 Viewports </A>
<LI><A HREF="gtk_tut-10.html#ss10.9">10.9 Scrolled Windows </A>
<LI><A HREF="gtk_tut-10.html#ss10.10">10.10 Button Boxes</A>
<LI><A HREF="gtk_tut-10.html#ss10.11">10.11 Toolbar</A>
<LI><A HREF="gtk_tut-10.html#ss10.12">10.12 Notebooks</A>
</UL>
<P>
<H2><A NAME="toc11">11.</A> <A HREF="gtk_tut-11.html">CList Widget</A></H2>

<UL>
<LI><A HREF="gtk_tut-11.html#ss11.1">11.1 Creating a CList widget</A>
<LI><A HREF="gtk_tut-11.html#ss11.2">11.2 Modes of operation</A>
<LI><A HREF="gtk_tut-11.html#ss11.3">11.3 Working with titles</A>
<LI><A HREF="gtk_tut-11.html#ss11.4">11.4 Manipulating the list itself</A>
<LI><A HREF="gtk_tut-11.html#ss11.5">11.5 Adding rows to the list</A>
<LI><A HREF="gtk_tut-11.html#ss11.6">11.6 Setting text and pixmaps in the cells</A>
<LI><A HREF="gtk_tut-11.html#ss11.7">11.7 Storing data pointers</A>
<LI><A HREF="gtk_tut-11.html#ss11.8">11.8 Working with selections</A>
<LI><A HREF="gtk_tut-11.html#ss11.9">11.9 The signals that bring it together</A>
<LI><A HREF="gtk_tut-11.html#ss11.10">11.10 A CList example</A>
</UL>
<P>
<H2><A NAME="toc12">12.</A> <A HREF="gtk_tut-12.html">Tree Widget </A></H2>

<UL>
<LI><A HREF="gtk_tut-12.html#ss12.1">12.1 Creating a Tree</A>
<LI><A HREF="gtk_tut-12.html#ss12.2">12.2 Adding a Subtree</A>
<LI><A HREF="gtk_tut-12.html#ss12.3">12.3 Handling the Selection List</A>
<LI><A HREF="gtk_tut-12.html#ss12.4">12.4 Tree Widget Internals</A>
<LI><A HREF="gtk_tut-12.html#ss12.5">12.5 Tree Item Widget</A>
<LI><A HREF="gtk_tut-12.html#ss12.6">12.6 Tree Example</A>
</UL>
<P>
<H2><A NAME="toc13">13.</A> <A HREF="gtk_tut-13.html">Menu Widget</A></H2>

<UL>
<LI><A HREF="gtk_tut-13.html#ss13.1">13.1 Manual Menu Creation</A>
<LI><A HREF="gtk_tut-13.html#ss13.2">13.2 Manual Menu Example</A>
<LI><A HREF="gtk_tut-13.html#ss13.3">13.3 Using ItemFactory</A>
<LI><A HREF="gtk_tut-13.html#ss13.4">13.4 Item Factory Example</A>
</UL>
<P>
<H2><A NAME="toc14">14.</A> <A HREF="gtk_tut-14.html">Text Widget</A></H2>

<UL>
<LI><A HREF="gtk_tut-14.html#ss14.1">14.1 Creating and Configuring a Text box</A>
<LI><A HREF="gtk_tut-14.html#ss14.2">14.2 Text Manipulation</A>
<LI><A HREF="gtk_tut-14.html#ss14.3">14.3 Keyboard Shortcuts</A>
<LI><A HREF="gtk_tut-14.html#ss14.4">14.4 A GtkText Example</A>
</UL>
<P>
<H2><A NAME="toc15">15.</A> <A HREF="gtk_tut-15.html">Undocumented Widgets</A></H2>

<UL>
<LI><A HREF="gtk_tut-15.html#ss15.1">15.1 CTree</A>
<LI><A HREF="gtk_tut-15.html#ss15.2">15.2 Curves</A>
<LI><A HREF="gtk_tut-15.html#ss15.3">15.3 Drawing Area</A>
<LI><A HREF="gtk_tut-15.html#ss15.4">15.4 Font Selection Dialog</A>
<LI><A HREF="gtk_tut-15.html#ss15.5">15.5 Gamma Curve</A>
<LI><A HREF="gtk_tut-15.html#ss15.6">15.6 Image</A>
<LI><A HREF="gtk_tut-15.html#ss15.7">15.7 Packer</A>
<LI><A HREF="gtk_tut-15.html#ss15.8">15.8 Plugs and Sockets</A>
<LI><A HREF="gtk_tut-15.html#ss15.9">15.9 Preview</A>
</UL>
<P>
<H2><A NAME="toc16">16.</A> <A HREF="gtk_tut-16.html">Setting Widget Attributes</A></H2>

<P>
<H2><A NAME="toc17">17.</A> <A HREF="gtk_tut-17.html">Timeouts, IO and Idle Functions</A></H2>

<UL>
<LI><A HREF="gtk_tut-17.html#ss17.1">17.1 Timeouts</A>
<LI><A HREF="gtk_tut-17.html#ss17.2">17.2 Monitoring IO</A>
<LI><A HREF="gtk_tut-17.html#ss17.3">17.3 Idle Functions</A>
</UL>
<P>
<H2><A NAME="toc18">18.</A> <A HREF="gtk_tut-18.html">Advanced Event and Signal Handling</A></H2>

<UL>
<LI><A HREF="gtk_tut-18.html#ss18.1">18.1 Signal Functions</A>
<LI><A HREF="gtk_tut-18.html#ss18.2">18.2 Signal Emission and Propagation</A>
</UL>
<P>
<H2><A NAME="toc19">19.</A> <A HREF="gtk_tut-19.html">Managing Selections</A></H2>

<UL>
<LI><A HREF="gtk_tut-19.html#ss19.1">19.1 Overview</A>
<LI><A HREF="gtk_tut-19.html#ss19.2">19.2 Retrieving the selection</A>
<LI><A HREF="gtk_tut-19.html#ss19.3">19.3 Supplying the selection </A>
</UL>
<P>
<H2><A NAME="toc20">20.</A> <A HREF="gtk_tut-20.html">GLib</A></H2>

<UL>
<LI><A HREF="gtk_tut-20.html#ss20.1">20.1 Definitions</A>
<LI><A HREF="gtk_tut-20.html#ss20.2">20.2 Doubly Linked Lists</A>
<LI><A HREF="gtk_tut-20.html#ss20.3">20.3 Singly Linked Lists</A>
<LI><A HREF="gtk_tut-20.html#ss20.4">20.4 Memory Management</A>
<LI><A HREF="gtk_tut-20.html#ss20.5">20.5 Timers</A>
<LI><A HREF="gtk_tut-20.html#ss20.6">20.6 String Handling</A>
<LI><A HREF="gtk_tut-20.html#ss20.7">20.7 Utility and Error Functions</A>
</UL>
<P>
<H2><A NAME="toc21">21.</A> <A HREF="gtk_tut-21.html">GTK's rc Files </A></H2>

<UL>
<LI><A HREF="gtk_tut-21.html#ss21.1">21.1 Functions For rc Files </A>
<LI><A HREF="gtk_tut-21.html#ss21.2">21.2 GTK's rc File Format</A>
<LI><A HREF="gtk_tut-21.html#ss21.3">21.3 Example rc file</A>
</UL>
<P>
<H2><A NAME="toc22">22.</A> <A HREF="gtk_tut-22.html">Writing Your Own Widgets </A></H2>

<UL>
<LI><A HREF="gtk_tut-22.html#ss22.1">22.1 Overview</A>
<LI><A HREF="gtk_tut-22.html#ss22.2">22.2 The Anatomy Of A Widget</A>
<LI><A HREF="gtk_tut-22.html#ss22.3">22.3 Creating a Composite widget</A>
<LI><A HREF="gtk_tut-22.html#ss22.4">22.4 Creating a widget from scratch.</A>
<LI><A HREF="gtk_tut-22.html#ss22.5">22.5 Learning More</A>
</UL>
<P>
<H2><A NAME="toc23">23.</A> <A HREF="gtk_tut-23.html">Scribble, A Simple Example Drawing Program</A></H2>

<UL>
<LI><A HREF="gtk_tut-23.html#ss23.1">23.1 Overview</A>
<LI><A HREF="gtk_tut-23.html#ss23.2">23.2 Event Handling</A>
<LI><A HREF="gtk_tut-23.html#ss23.3">23.3 The DrawingArea Widget, And Drawing</A>
<LI><A HREF="gtk_tut-23.html#ss23.4">23.4 Adding XInput support</A>
</UL>
<P>
<H2><A NAME="toc24">24.</A> <A HREF="gtk_tut-24.html">Tips For Writing GTK Applications</A></H2>

<P>
<H2><A NAME="toc25">25.</A> <A HREF="gtk_tut-25.html">Contributing </A></H2>

<P>
<H2><A NAME="toc26">26.</A> <A HREF="gtk_tut-26.html">Credits</A></H2>

<P>
<H2><A NAME="toc27">27.</A> <A HREF="gtk_tut-27.html">Tutorial Copyright and Permissions Notice</A></H2>

<H2>Appendix</H2>
<P>
<H2><A NAME="toc28">28.</A> <A HREF="gtk_tut-28.html">GTK Signals </A></H2>

<UL>
<LI><A HREF="gtk_tut-28.html#ss28.1">28.1 GtkObject</A>
<LI><A HREF="gtk_tut-28.html#ss28.2">28.2 GtkWidget</A>
<LI><A HREF="gtk_tut-28.html#ss28.3">28.3 GtkData</A>
<LI><A HREF="gtk_tut-28.html#ss28.4">28.4 GtkContainer</A>
<LI><A HREF="gtk_tut-28.html#ss28.5">28.5 GtkCalendar</A>
<LI><A HREF="gtk_tut-28.html#ss28.6">28.6 GtkEditable</A>
<LI><A HREF="gtk_tut-28.html#ss28.7">28.7 GtkTipsQuery</A>
<LI><A HREF="gtk_tut-28.html#ss28.8">28.8 GtkCList</A>
<LI><A HREF="gtk_tut-28.html#ss28.9">28.9 GtkNotebook</A>
<LI><A HREF="gtk_tut-28.html#ss28.10">28.10 GtkList</A>
<LI><A HREF="gtk_tut-28.html#ss28.11">28.11 GtkMenuShell</A>
<LI><A HREF="gtk_tut-28.html#ss28.12">28.12 GtkToolbar</A>
<LI><A HREF="gtk_tut-28.html#ss28.13">28.13 GtkTree</A>
<LI><A HREF="gtk_tut-28.html#ss28.14">28.14 GtkButton</A>
<LI><A HREF="gtk_tut-28.html#ss28.15">28.15 GtkItem</A>
<LI><A HREF="gtk_tut-28.html#ss28.16">28.16 GtkWindow</A>
<LI><A HREF="gtk_tut-28.html#ss28.17">28.17 GtkHandleBox</A>
<LI><A HREF="gtk_tut-28.html#ss28.18">28.18 GtkToggleButton</A>
<LI><A HREF="gtk_tut-28.html#ss28.19">28.19 GtkMenuItem</A>
<LI><A HREF="gtk_tut-28.html#ss28.20">28.20 GtkListItem</A>
<LI><A HREF="gtk_tut-28.html#ss28.21">28.21 GtkTreeItem</A>
<LI><A HREF="gtk_tut-28.html#ss28.22">28.22 GtkCheckMenuItem</A>
<LI><A HREF="gtk_tut-28.html#ss28.23">28.23 GtkInputDialog</A>
<LI><A HREF="gtk_tut-28.html#ss28.24">28.24 GtkColorSelection</A>
<LI><A HREF="gtk_tut-28.html#ss28.25">28.25 GtkStatusBar</A>
<LI><A HREF="gtk_tut-28.html#ss28.26">28.26 GtkCTree</A>
<LI><A HREF="gtk_tut-28.html#ss28.27">28.27 GtkCurve</A>
<LI><A HREF="gtk_tut-28.html#ss28.28">28.28 GtkAdjustment</A>
</UL>
<P>
<H2><A NAME="toc29">29.</A> <A HREF="gtk_tut-29.html">GDK Event Types</A></H2>

<P>
<H2><A NAME="toc30">30.</A> <A HREF="gtk_tut-30.html">Code Examples</A></H2>

<UL>
<LI><A HREF="gtk_tut-30.html#ss30.1">30.1 Tictactoe</A>
<LI><A HREF="gtk_tut-30.html#ss30.2">30.2 GtkDial</A>
<LI><A HREF="gtk_tut-30.html#ss30.3">30.3 Scribble</A>
</UL>
<P>
<H2><A NAME="toc31">31.</A> <A HREF="gtk_tut-31.html">List Widget</A></H2>

<UL>
<LI><A HREF="gtk_tut-31.html#ss31.1">31.1 Signals</A>
<LI><A HREF="gtk_tut-31.html#ss31.2">31.2 Functions</A>
<LI><A HREF="gtk_tut-31.html#ss31.3">31.3 Example</A>
<LI><A HREF="gtk_tut-31.html#ss31.4">31.4 List Item Widget</A>
<LI><A HREF="gtk_tut-31.html#ss31.5">31.5 Signals</A>
<LI><A HREF="gtk_tut-31.html#ss31.6">31.6 Functions</A>
<LI><A HREF="gtk_tut-31.html#ss31.7">31.7 Example</A>
</UL>
<HR NOSHADE>
<A HREF="gtk_tut-1.html">Next</A>
Previous
Contents
</BODY>
</HTML>