~canonical-dx-team/ubuntu/maverick/gtk+2.0/menuproxy

« back to all changes in this revision

Viewing changes to docs/tutorial/html/x390.html

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-05-04 12:24:25 UTC
  • mfrom: (1.1.21 upstream)
  • Revision ID: james.westby@ubuntu.com-20070504122425-0m8midgzrp40y8w2
Tags: 2.10.12-1ubuntu1
* Sync with Debian
* New upstream version:
  Fixed bugs:
  - 379414 file chooser warnings when changing path in the entry
  - 418585 GtkFileChooserDefault sizing code is not DPI independent
  - 419568 Crash in search if start with special letter
  - 435062 build dies with icon cache validation
  - 379399 Segfault to call gtk_print_operation_run twice.
  - 387889 cups backend has problems when there are too many printers
  - 418531 invalid read to gtkicontheme.c gtk_icon_theme_lookup_icon...
  - 423916 crash in color scheme code
  - 424042 Segmentation fault while quickly pressing Alt+arrows
  - 415260 Protect against negative indices when setting values in G...
  - 419171 XGetVisualInfo() may not set nxvisuals
  - 128852 Gdk cursors don't look good on win32
  - 344657 Ctrl-H doesn't toggle "Show Hidden Files" setting
  - 345345 PrintOperation::paginate is not emitted for class handler
  - 347567 GtkPrintOperation::end-print is not emitted if it's cance...
  - 369112 gtk_ui_manager_add_ui should accept unnamed separator
  - 392015 Selected menu item invisible on Windows Vista
  - 399253 MS-Windows Theme Bottom Tab placement rendering glitches
  - 399425 gtk_input_dialog_fill_axes() adds child to gtkscrolledwin...
  - 403251 [patch] little memory leak in GtkPrintJob
  - 403267 [patch] memory leak in GtkPageSetupUnixDialog
  - 403470 MS-Windows Theme tab placement other than on top leaks a ...
  - 404506 Windows system fonts that have multi-byte font names cann...
  - 405089 Incorrect window placement for GtkEventBox private window
  - 405515 Minor leak in gtkfilesystemmodel.c
  - 405539 gdk_pixbuf_save() for PNG saver can return FALSE without ...
  - 415681 gdk_window_clear_area includes an extra line and column o...
  - 418219 GtkRecentChooser should apply filter before sorting and c...
  - 418403 Scroll to printer after selecting it from settings
  - 421985 _gtk_print_operation_platform_backend_launch_preview
  - 421990 gtk_print_job_get_surface
  - 421993 gtk_print_operation_init
  - 423064 Conditional jump or move depends on uninitialised value(s...
  - 423722 Fix printing header in gtk-demo
  - 424168 gtk_print_operation_run on async preview
  - 425655 Don't install gtk+-unix-print-2.0.pc on non-UNIX platforms
  - 425786 GDK segfaults if XineramaQueryScreens fails
  - 428665 Lpr Backend gets stuck in infinite loop during gtk_enumer...
  - 429902 GtkPrintOperation leaks cairo contextes
  - 431997 First delay of GdkPixbufAnimationIter is wrong
  - 433242 Inconsistent scroll arrow position calculations
  - 433972 Placing gtk.Expander inside a gtk.TextView() changes gtk....
  - 434261 _gtk_toolbar_elide_underscores incorrectly handles some s...
  - 383354 ctrl-L should make 'Location' entry disappear
  - 418673 gtk_recent_manager_add_item
  - 429732 gtk_accel_group_finalize accesses invalid memory
  - 435028 WM_CLIENT_LEADER is wrong on the leader_window
  - 431067 Background of the header window is not updated
  - 338843 add recent files support inside the ui manager
  - 148535 add drop shadow to menus, tooltips, etc. under Windows XP
* debian/control.in:
  - Conflicts on ubuntulooks (<= 0.9.11-1)
* debian/patches/15_default-fallback-icon-theme.patch:
  - patch from Debian, fallback on gnome icon theme

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/loose.dtd">
 
2
<HTML
 
3
><HEAD
 
4
><TITLE
 
5
>Packing Using Tables</TITLE
 
6
><META
 
7
NAME="GENERATOR"
 
8
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
 
9
REL="HOME"
 
10
TITLE="GTK+ 2.0 Tutorial"
 
11
HREF="book1.html"><LINK
 
12
REL="UP"
 
13
TITLE="Packing Widgets"
 
14
HREF="c355.html"><LINK
 
15
REL="PREVIOUS"
 
16
TITLE="Packing Demonstration Program"
 
17
HREF="x387.html"><LINK
 
18
REL="NEXT"
 
19
TITLE="Table Packing Example"
 
20
HREF="x442.html"></HEAD
 
21
><BODY
 
22
CLASS="SECT1"
 
23
BGCOLOR="#FFFFFF"
 
24
TEXT="#000000"
 
25
LINK="#0000FF"
 
26
VLINK="#840084"
 
27
ALINK="#0000FF"
 
28
><DIV
 
29
CLASS="NAVHEADER"
 
30
><TABLE
 
31
SUMMARY="Header navigation table"
 
32
WIDTH="100%"
 
33
BORDER="0"
 
34
CELLPADDING="0"
 
35
CELLSPACING="0"
 
36
><TR
 
37
><TH
 
38
COLSPAN="3"
 
39
ALIGN="center"
 
40
>GTK+ 2.0 Tutorial</TH
 
41
></TR
 
42
><TR
 
43
><TD
 
44
WIDTH="10%"
 
45
ALIGN="left"
 
46
VALIGN="bottom"
 
47
><A
 
48
HREF="x387.html"
 
49
ACCESSKEY="P"
 
50
>&#60;&#60;&#60; Previous</A
 
51
></TD
 
52
><TD
 
53
WIDTH="80%"
 
54
ALIGN="center"
 
55
VALIGN="bottom"
 
56
>Packing Widgets</TD
 
57
><TD
 
58
WIDTH="10%"
 
59
ALIGN="right"
 
60
VALIGN="bottom"
 
61
><A
 
62
HREF="x442.html"
 
63
ACCESSKEY="N"
 
64
>Next &#62;&#62;&#62;</A
 
65
></TD
 
66
></TR
 
67
></TABLE
 
68
><HR
 
69
ALIGN="LEFT"
 
70
WIDTH="100%"></DIV
 
71
><DIV
 
72
CLASS="SECT1"
 
73
><H1
 
74
CLASS="SECT1"
 
75
><A
 
76
NAME="SEC-PACKINGUSINGTABLES"
 
77
>Packing Using Tables</A
 
78
></H1
 
79
><P
 
80
>Let's take a look at another way of packing - Tables. These can be
 
81
extremely useful in certain situations.</P
 
82
><P
 
83
>Using tables, we create a grid that we can place widgets in. The
 
84
widgets may take up as many spaces as we specify.</P
 
85
><P
 
86
>The first thing to look at, of course, is the gtk_table_new() function:</P
 
87
><TABLE
 
88
BORDER="0"
 
89
BGCOLOR="#E0E0E0"
 
90
WIDTH="100%"
 
91
><TR
 
92
><TD
 
93
><PRE
 
94
CLASS="PROGRAMLISTING"
 
95
>GtkWidget *gtk_table_new( guint    rows,
 
96
                          guint    columns,
 
97
                          gboolean homogeneous );</PRE
 
98
></TD
 
99
></TR
 
100
></TABLE
 
101
><P
 
102
>The first argument is the number of rows to make in the table, while
 
103
the second, obviously, is the number of columns.</P
 
104
><P
 
105
>The homogeneous argument has to do with how the table's boxes are
 
106
sized. If homogeneous is TRUE, the table boxes are resized to the size
 
107
of the largest widget in the table. If homogeneous is FALSE, the size
 
108
of a table boxes is dictated by the tallest widget in its same row,
 
109
and the widest widget in its column.</P
 
110
><P
 
111
>The rows and columns are laid out from 0 to n, where n was the number
 
112
specified in the call to gtk_table_new. So, if you specify rows = 2
 
113
and columns = 2, the layout would look something like this:</P
 
114
><TABLE
 
115
BORDER="0"
 
116
BGCOLOR="#E0E0E0"
 
117
WIDTH="100%"
 
118
><TR
 
119
><TD
 
120
><PRE
 
121
CLASS="PROGRAMLISTING"
 
122
> 0          1          2
 
123
0+----------+----------+
 
124
 |          |          |
 
125
1+----------+----------+
 
126
 |          |          |
 
127
2+----------+----------+</PRE
 
128
></TD
 
129
></TR
 
130
></TABLE
 
131
><P
 
132
>Note that the coordinate system starts in the upper left hand corner.
 
133
To place a widget into a box, use the following function:</P
 
134
><TABLE
 
135
BORDER="0"
 
136
BGCOLOR="#E0E0E0"
 
137
WIDTH="100%"
 
138
><TR
 
139
><TD
 
140
><PRE
 
141
CLASS="PROGRAMLISTING"
 
142
>void gtk_table_attach( GtkTable         *table,
 
143
                       GtkWidget        *child,
 
144
                       guint            left_attach,
 
145
                       guint            right_attach,
 
146
                       guint            top_attach,
 
147
                       guint            bottom_attach,
 
148
                       GtkAttachOptions xoptions,
 
149
                       GtkAttachOptions yoptions,
 
150
                       guint            xpadding,
 
151
                       guint            ypadding );</PRE
 
152
></TD
 
153
></TR
 
154
></TABLE
 
155
><P
 
156
>The first argument ("table") is the table you've created and the
 
157
second ("child") the widget you wish to place in the table.</P
 
158
><P
 
159
>The left and right attach arguments specify where to place the widget,
 
160
and how many boxes to use. If you want a button in the lower right
 
161
table entry of our 2x2 table, and want it to fill that entry <I
 
162
CLASS="EMPHASIS"
 
163
>only</I
 
164
>,
 
165
left_attach would be = 1, right_attach = 2, top_attach = 1,
 
166
bottom_attach = 2.</P
 
167
><P
 
168
>Now, if you wanted a widget to take up the whole top row of our 2x2
 
169
table, you'd use left_attach = 0, right_attach = 2, top_attach = 0,
 
170
bottom_attach = 1.</P
 
171
><P
 
172
>The xoptions and yoptions are used to specify packing options and may
 
173
be bitwise OR'ed together to allow multiple options.</P
 
174
><P
 
175
>These options are:</P
 
176
><P
 
177
></P
 
178
><DIV
 
179
CLASS="VARIABLELIST"
 
180
><DL
 
181
><DT
 
182
><TT
 
183
CLASS="LITERAL"
 
184
>GTK_FILL</TT
 
185
></DT
 
186
><DD
 
187
><P
 
188
>If the table box is larger than the widget, and
 
189
<TT
 
190
CLASS="LITERAL"
 
191
>GTK_FILL</TT
 
192
> is specified, the widget will expand to use all the room
 
193
available.</P
 
194
></DD
 
195
><DT
 
196
><TT
 
197
CLASS="LITERAL"
 
198
>GTK_SHRINK</TT
 
199
></DT
 
200
><DD
 
201
><P
 
202
>If the table widget was allocated less space
 
203
then was requested (usually by the user resizing the window), then the
 
204
widgets would normally just be pushed off the bottom of the window and
 
205
disappear. If <TT
 
206
CLASS="LITERAL"
 
207
>GTK_SHRINK</TT
 
208
> is specified, the widgets will shrink
 
209
with the table.</P
 
210
></DD
 
211
><DT
 
212
><TT
 
213
CLASS="LITERAL"
 
214
>GTK_EXPAND</TT
 
215
></DT
 
216
><DD
 
217
><P
 
218
>This will cause the table to expand to use up
 
219
any remaining space in the window.</P
 
220
></DD
 
221
></DL
 
222
></DIV
 
223
><P
 
224
>Padding is just like in boxes, creating a clear area around the widget
 
225
specified in pixels.</P
 
226
><P
 
227
>gtk_table_attach() has a <I
 
228
CLASS="EMPHASIS"
 
229
>lot</I
 
230
> of options.  
 
231
So, there's a shortcut:</P
 
232
><TABLE
 
233
BORDER="0"
 
234
BGCOLOR="#E0E0E0"
 
235
WIDTH="100%"
 
236
><TR
 
237
><TD
 
238
><PRE
 
239
CLASS="PROGRAMLISTING"
 
240
>void gtk_table_attach_defaults( GtkTable  *table,
 
241
                                GtkWidget *widget,
 
242
                                guint      left_attach,
 
243
                                guint      right_attach,
 
244
                                guint      top_attach,
 
245
                                guint      bottom_attach );</PRE
 
246
></TD
 
247
></TR
 
248
></TABLE
 
249
><P
 
250
>The X and Y options default to <TT
 
251
CLASS="LITERAL"
 
252
>GTK_FILL | GTK_EXPAND</TT
 
253
>, 
 
254
and X and Y padding are set to 0. The rest of the arguments are identical to the
 
255
previous function.</P
 
256
><P
 
257
>We also have gtk_table_set_row_spacing() and
 
258
gtk_table_set_col_spacing(). These places spacing between the rows at
 
259
the specified row or column.</P
 
260
><TABLE
 
261
BORDER="0"
 
262
BGCOLOR="#E0E0E0"
 
263
WIDTH="100%"
 
264
><TR
 
265
><TD
 
266
><PRE
 
267
CLASS="PROGRAMLISTING"
 
268
>void gtk_table_set_row_spacing( GtkTable *table,
 
269
                                guint     row,
 
270
                                guint     spacing );</PRE
 
271
></TD
 
272
></TR
 
273
></TABLE
 
274
><P
 
275
>and</P
 
276
><TABLE
 
277
BORDER="0"
 
278
BGCOLOR="#E0E0E0"
 
279
WIDTH="100%"
 
280
><TR
 
281
><TD
 
282
><PRE
 
283
CLASS="PROGRAMLISTING"
 
284
>void gtk_table_set_col_spacing ( GtkTable *table,
 
285
                                 guint     column,
 
286
                                 guint     spacing );</PRE
 
287
></TD
 
288
></TR
 
289
></TABLE
 
290
><P
 
291
>Note that for columns, the space goes to the right of the column, and
 
292
for rows, the space goes below the row.</P
 
293
><P
 
294
>You can also set a consistent spacing of all rows and/or columns with:</P
 
295
><TABLE
 
296
BORDER="0"
 
297
BGCOLOR="#E0E0E0"
 
298
WIDTH="100%"
 
299
><TR
 
300
><TD
 
301
><PRE
 
302
CLASS="PROGRAMLISTING"
 
303
>void gtk_table_set_row_spacings( GtkTable *table,
 
304
                                 guint    spacing );</PRE
 
305
></TD
 
306
></TR
 
307
></TABLE
 
308
><P
 
309
>And,</P
 
310
><TABLE
 
311
BORDER="0"
 
312
BGCOLOR="#E0E0E0"
 
313
WIDTH="100%"
 
314
><TR
 
315
><TD
 
316
><PRE
 
317
CLASS="PROGRAMLISTING"
 
318
>void gtk_table_set_col_spacings( GtkTable *table,
 
319
                                 guint     spacing );</PRE
 
320
></TD
 
321
></TR
 
322
></TABLE
 
323
><P
 
324
>Note that with these calls, the last row and last column do not get
 
325
any spacing.</P
 
326
></DIV
 
327
><DIV
 
328
CLASS="NAVFOOTER"
 
329
><HR
 
330
ALIGN="LEFT"
 
331
WIDTH="100%"><TABLE
 
332
SUMMARY="Footer navigation table"
 
333
WIDTH="100%"
 
334
BORDER="0"
 
335
CELLPADDING="0"
 
336
CELLSPACING="0"
 
337
><TR
 
338
><TD
 
339
WIDTH="33%"
 
340
ALIGN="left"
 
341
VALIGN="top"
 
342
><A
 
343
HREF="x387.html"
 
344
ACCESSKEY="P"
 
345
>&#60;&#60;&#60; Previous</A
 
346
></TD
 
347
><TD
 
348
WIDTH="34%"
 
349
ALIGN="center"
 
350
VALIGN="top"
 
351
><A
 
352
HREF="book1.html"
 
353
ACCESSKEY="H"
 
354
>Home</A
 
355
></TD
 
356
><TD
 
357
WIDTH="33%"
 
358
ALIGN="right"
 
359
VALIGN="top"
 
360
><A
 
361
HREF="x442.html"
 
362
ACCESSKEY="N"
 
363
>Next &#62;&#62;&#62;</A
 
364
></TD
 
365
></TR
 
366
><TR
 
367
><TD
 
368
WIDTH="33%"
 
369
ALIGN="left"
 
370
VALIGN="top"
 
371
>Packing Demonstration Program</TD
 
372
><TD
 
373
WIDTH="34%"
 
374
ALIGN="center"
 
375
VALIGN="top"
 
376
><A
 
377
HREF="c355.html"
 
378
ACCESSKEY="U"
 
379
>Up</A
 
380
></TD
 
381
><TD
 
382
WIDTH="33%"
 
383
ALIGN="right"
 
384
VALIGN="top"
 
385
>Table Packing Example</TD
 
386
></TR
 
387
></TABLE
 
388
></DIV
 
389
></BODY
 
390
></HTML
 
391
>
 
 
b'\\ No newline at end of file'