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

« back to all changes in this revision

Viewing changes to docs/reference/gtk/html/gtk-changes-1-2.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 Transitional//EN">
 
2
<html>
 
3
<head>
 
4
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
 
5
<title>Changes from 1.0 to 1.2</title>
 
6
<meta name="generator" content="DocBook XSL Stylesheets V1.72.0">
 
7
<link rel="start" href="index.html" title="GTK+ Reference Manual">
 
8
<link rel="up" href="migrating.html" title="Part&#160;IV.&#160;Migrating from Previous Versions of GTK+">
 
9
<link rel="prev" href="checklist-named-icons.html" title="Use named icons">
 
10
<link rel="next" href="gtk-changes-2-0.html" title="Changes from 1.2 to 2.0">
 
11
<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
 
12
<link rel="stylesheet" href="style.css" type="text/css">
 
13
<link rel="part" href="gtk.html" title="Part&#160;I.&#160;GTK+ Overview">
 
14
<link rel="part" href="gtkbase.html" title="Part&#160;II.&#160;GTK+ Core Reference">
 
15
<link rel="part" href="gtkobjects.html" title="Part&#160;III.&#160;GTK+ Widgets and Objects">
 
16
<link rel="chapter" href="ch01.html" title="Object Hierarchy">
 
17
<link rel="chapter" href="ch02.html" title="Widget Gallery">
 
18
<link rel="chapter" href="WindowWidgets.html" title="Windows">
 
19
<link rel="chapter" href="DisplayWidgets.html" title="Display Widgets">
 
20
<link rel="chapter" href="ButtonWidgets.html" title="Buttons and Toggles">
 
21
<link rel="chapter" href="NumericEntry.html" title="Numeric/Text Data Entry">
 
22
<link rel="chapter" href="TextWidgetObjects.html" title="Multiline Text Editor">
 
23
<link rel="chapter" href="TreeWidgetObjects.html" title="Tree, List and Icon Grid Widgets">
 
24
<link rel="chapter" href="MenusAndCombos.html" title="Menus, Combo Box, Toolbar">
 
25
<link rel="chapter" href="Actions.html" title="Action-based menus and toolbars">
 
26
<link rel="chapter" href="SelectorWidgets.html" title="Selectors (File/Font/Color/Input Devices)">
 
27
<link rel="chapter" href="LayoutContainers.html" title="Layout Containers">
 
28
<link rel="chapter" href="Ornaments.html" title="Ornaments">
 
29
<link rel="chapter" href="ScrollingWidgets.html" title="Scrolling">
 
30
<link rel="chapter" href="Printing.html" title="Printing">
 
31
<link rel="chapter" href="MiscObjects.html" title="Miscellaneous">
 
32
<link rel="chapter" href="AbstractObjects.html" title="Abstract Base Classes">
 
33
<link rel="chapter" href="PlugSocket.html" title="Cross-process Embedding">
 
34
<link rel="chapter" href="SpecialObjects.html" title="Special-purpose features">
 
35
<link rel="chapter" href="RecentDocuments.html" title="Recently Used Documents">
 
36
<link rel="chapter" href="DeprecatedObjects.html" title="Deprecated">
 
37
<link rel="part" href="migrating.html" title="Part&#160;IV.&#160;Migrating from Previous Versions of GTK+">
 
38
<link rel="chapter" href="gtk-migrating-checklist.html" title="Migration Checklist">
 
39
<link rel="chapter" href="gtk-migrating-GtkFileChooser.html" title="Migrating from GtkFileSelection to GtkFileChooser">
 
40
<link rel="chapter" href="gtk-migrating-GtkAction.html" title="Migrating from old menu and toolbar systems to GtkAction">
 
41
<link rel="chapter" href="gtk-migrating-GtkComboBox.html" title="Migrating from GtkOptionMenu and GtkCombo to GtkComboBox and GtkComboBoxEntry">
 
42
<link rel="chapter" href="gtk-migrating-GtkIconView.html" title="Migrating from GnomeIconList to GtkIconView">
 
43
<link rel="chapter" href="gtk-migrating-GtkAboutDialog.html" title="Migrating from GnomeAbout to GtkAboutDialog">
 
44
<link rel="chapter" href="gtk-migrating-GtkColorButton.html" title="Migrating from GnomeColorPicker to GtkColorButton">
 
45
<link rel="chapter" href="gtk-migrating-GtkAssistant.html" title="Migrating from GnomeDruid to GtkAssistant">
 
46
<link rel="chapter" href="gtk-migrating-GtkRecentChooser.html" title="Migrating from EggRecent to GtkRecentChooser">
 
47
<link rel="chapter" href="gtk-migrating-GtkLinkButton.html" title="Migrating from GnomeHRef to GtkLinkButton">
 
48
<link rel="part" href="pt05.html" title="Part&#160;V.&#160;GTK+ Tools">
 
49
<link rel="glossary" href="glossary.html" title="Glossary">
 
50
<link rel="index" href="ix01.html" title="Index">
 
51
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
 
52
<link rel="index" href="ix03.html" title="Index of new symbols in 2.2">
 
53
<link rel="index" href="ix04.html" title="Index of new symbols in 2.4">
 
54
<link rel="index" href="ix05.html" title="Index of new symbols in 2.6">
 
55
<link rel="index" href="ix06.html" title="Index of new symbols in 2.8">
 
56
<link rel="index" href="ix07.html" title="Index of new symbols in 2.10">
 
57
</head>
 
58
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 
59
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
 
60
<td><a accesskey="p" href="checklist-named-icons.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
 
61
<td><a accesskey="u" href="migrating.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
 
62
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
 
63
<th width="100%" align="center">GTK+ Reference Manual</th>
 
64
<td><a accesskey="n" href="gtk-changes-2-0.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
 
65
</tr></table>
 
66
<div class="refentry" lang="en">
 
67
<a name="gtk-changes-1-2"></a><div class="titlepage"></div>
 
68
<div class="refnamediv"><table width="100%"><tr>
 
69
<td valign="top">
 
70
<h2><span class="refentrytitle">Changes from 1.0 to 1.2</span></h2>
 
71
<p>Changes from 1.0 to 1.2 &#8212; 
 
72
Incompatible changes made between version 1.0 and version 1.2
 
73
</p>
 
74
</td>
 
75
<td valign="top" align="right"></td>
 
76
</tr></table></div>
 
77
<div class="refsect1" lang="en">
 
78
<a name="id4005488"></a><h2>Incompatible changes from 1.0 to 1.2</h2>
 
79
<div class="itemizedlist"><ul type="disc">
 
80
<li><p>
 
81
<span class="structname">GtkAcceleratorTable</span> has been replaced with 
 
82
<span class="structname">GtkAccelGroup</span>.
 
83
</p></li>
 
84
<li><p>
 
85
<span class="structname">GtkMenuFactory</span> has been replaced with 
 
86
<span class="structname">GtkItemFactory</span>, although
 
87
a version of <span class="structname">GtkMenuFactory</span> is currently still 
 
88
provided to ease the migration phase.
 
89
</p></li>
 
90
<li>
 
91
<p>
 
92
The <span class="structname">GtkTypeInfo</span> structures used in the 
 
93
<code class="function">gtk_*_type_init()</code> functions have
 
94
changed a bit, the old format:
 
95
</p>
 
96
<pre class="programlisting">
 
97
      GtkTypeInfo bin_info =
 
98
      {
 
99
        "GtkBin",
 
100
        sizeof (GtkBin),
 
101
        sizeof (GtkBinClass),
 
102
        (GtkClassInitFunc) gtk_bin_class_init,
 
103
        (GtkObjectInitFunc) gtk_bin_init,
 
104
        (GtkArgSetFunc) NULL,
 
105
        (GtkArgGetFunc) NULL,
 
106
      };
 
107
</pre>
 
108
<p>
 
109
 
 
110
  needs to be converted to:
 
111
 
 
112
</p>
 
113
<pre class="programlisting">
 
114
      static const GtkTypeInfo bin_info =
 
115
      {
 
116
        "GtkBin",
 
117
        sizeof (GtkBin),
 
118
        sizeof (GtkBinClass),
 
119
        (GtkClassInitFunc) gtk_bin_class_init,
 
120
        (GtkObjectInitFunc) gtk_bin_init,
 
121
        /* reserved_1 */ NULL,
 
122
        /* reserved_2 */ NULL,
 
123
        (GtkClassInitFunc) NULL,
 
124
      };
 
125
</pre>
 
126
<p>
 
127
 
 
128
  the <code class="function">GtkArgSetFunc</code> and <code class="function">GtkArgGetFunc</code>
 
129
  functions are not supported from the type system anymore, and you should make
 
130
  sure that your code only fills in these fields with <code class="literal">NULL</code> 
 
131
  and doesn't use the deprecated function typedefs 
 
132
  <code class="literal">(GtkArgSetFunc)</code> and <code class="literal">(GtkArgGetFunc)</code> 
 
133
  anymore.
 
134
</p>
 
135
</li>
 
136
<li>
 
137
<p>
 
138
A number of GTK+ functions were renamed. For compatibility, 
 
139
  <code class="filename">gtkcompat.h</code> #define's the old 1.0.x function names in 
 
140
  terms of the new names. To assure your GTK+ program doesn't rely on outdated
 
141
  function variants, compile your program with 
 
142
  <code class="option">-DGTK_DISABLE_COMPAT_H</code> to disable
 
143
  the compatibility aliases.
 
144
 
 
145
  Here is the list of the old names and replacements:
 
146
 
 
147
</p>
 
148
<div class="informaltable"><table border="1">
 
149
<colgroup>
 
150
<col>
 
151
<col>
 
152
</colgroup>
 
153
<thead><tr>
 
154
<th>Old</th>
 
155
<th>Replacement</th>
 
156
</tr></thead>
 
157
<tbody>
 
158
<tr>
 
159
<td><code class="function">gtk_accel_label_accelerator_width</code></td>
 
160
<td><code class="function">gtk_accel_label_get_accel_width</code></td>
 
161
</tr>
 
162
<tr>
 
163
<td><code class="function">gtk_check_menu_item_set_state</code></td>
 
164
<td><code class="function">gtk_check_menu_item_set_active</code></td>
 
165
</tr>
 
166
<tr>
 
167
<td><code class="function">gtk_container_border_width</code></td>
 
168
<td><code class="function">gtk_container_set_border_width</code></td>
 
169
</tr>
 
170
<tr>
 
171
<td><code class="function">gtk_label_set</code></td>
 
172
<td><code class="function">gtk_label_set_text</code></td>
 
173
</tr>
 
174
<tr>
 
175
<td><code class="function">gtk_notebook_current_page</code></td>
 
176
<td><code class="function">gtk_notebook_get_current_page</code></td>
 
177
</tr>
 
178
<tr>
 
179
<td><code class="function">gtk_packer_configure</code></td>
 
180
<td><code class="function">gtk_packer_set_child_packing</code></td>
 
181
</tr>
 
182
<tr>
 
183
<td><code class="function">gtk_paned_gutter_size</code></td>
 
184
<td><code class="function">gtk_paned_set_gutter_size</code></td>
 
185
</tr>
 
186
<tr>
 
187
<td><code class="function">gtk_paned_handle_size</code></td>
 
188
<td><code class="function">gtk_paned_set_handle_size</code></td>
 
189
</tr>
 
190
<tr>
 
191
<td><code class="function">gtk_scale_value_width</code></td>
 
192
<td><code class="function">gtk_scale_get_value_width</code></td>
 
193
</tr>
 
194
<tr>
 
195
<td><code class="function">gtk_style_apply_default_pixmap</code></td>
 
196
<td><code class="function">gtk_style_apply_default_background</code></td>
 
197
</tr>
 
198
<tr>
 
199
<td><code class="function">gtk_toggle_button_set_state</code></td>
 
200
<td><code class="function">gtk_toggle_button_set_active</code></td>
 
201
</tr>
 
202
<tr>
 
203
<td><code class="function">gtk_window_position</code></td>
 
204
<td><code class="function">gtk_window_set_position</code></td>
 
205
</tr>
 
206
</tbody>
 
207
</table></div>
 
208
<p> 
 
209
Note that <code class="function">gtk_style_apply_default_background()</code> has an 
 
210
      additional argument, <code class="literal">set_bg</code>. This parameter should be 
 
211
      <code class="literal">FALSE</code> if the background is being set for a 
 
212
      <code class="literal">NO_WINDOW</code> widget, otherwise <code class="literal">TRUE</code>.
 
213
</p>
 
214
</li>
 
215
<li>
 
216
<p>
 
217
During the development phase of the 1.1.x line of GTK+ certain functions
 
218
  were deprecated and later removed. Functions affected are:
 
219
 
 
220
</p>
 
221
<div class="informaltable"><table border="1">
 
222
<colgroup>
 
223
<col>
 
224
<col>
 
225
</colgroup>
 
226
<thead><tr>
 
227
<th>Removed</th>
 
228
<th>Replacement</th>
 
229
</tr></thead>
 
230
<tbody>
 
231
<tr>
 
232
<td><code class="function">gtk_clist_set_border</code></td>
 
233
<td><code class="function">gtk_clist_set_shadow_type</code></td>
 
234
</tr>
 
235
<tr>
 
236
<td><code class="function">gtk_container_block_resize</code></td>
 
237
<td><code class="function">gtk_container_set_resize_mode</code></td>
 
238
</tr>
 
239
<tr>
 
240
<td><code class="function">gtk_container_unblock_resize</code></td>
 
241
<td><code class="function">gtk_container_set_resize_mode</code></td>
 
242
</tr>
 
243
<tr>
 
244
<td><code class="function">gtk_container_need_resize</code></td>
 
245
<td><code class="function">gtk_container_check_resize</code></td>
 
246
</tr>
 
247
<tr>
 
248
<td><code class="function">gtk_ctree_show_stub</code></td>
 
249
<td><code class="function">gtk_ctree_set_show_stub</code></td>
 
250
</tr>
 
251
<tr>
 
252
<td><code class="function">gtk_ctree_set_reorderable</code></td>
 
253
<td><code class="function">gtk_clist_set_reorderable</code></td>
 
254
</tr>
 
255
<tr>
 
256
<td><code class="function">gtk_ctree_set_use_drag_icons</code></td>
 
257
<td><code class="function">gtk_clist_set_use_drag_icons</code></td>
 
258
</tr>
 
259
<tr>
 
260
<td><code class="function">gtk_entry_adjust_scroll</code></td>
 
261
<td><code class="function">-</code></td>
 
262
</tr>
 
263
<tr>
 
264
<td><code class="function">gtk_object_class_add_user_signal</code></td>
 
265
<td><code class="function">gtk_object_class_user_signal_new</code></td>
 
266
</tr>
 
267
<tr>
 
268
<td><code class="function">gtk_preview_put_row</code></td>
 
269
<td><code class="function">gtk_preview_put</code></td>
 
270
</tr>
 
271
<tr>
 
272
<td><code class="function">gtk_progress_bar_construct</code></td>
 
273
<td><code class="function">gtk_progress_set_adjustment</code></td>
 
274
</tr>
 
275
<tr>
 
276
<td><code class="function">gtk_scrolled_window_construct</code></td>
 
277
<td><code class="function">gtk_scrolled_window_set_{h|v}adjustment</code></td>
 
278
</tr>
 
279
<tr>
 
280
<td><code class="function">gtk_spin_button_construct</code></td>
 
281
<td><code class="function">gtk_spin_button_configure</code></td>
 
282
</tr>
 
283
<tr>
 
284
<td><code class="function">gtk_widget_thaw_accelerators</code></td>
 
285
<td><code class="function">gtk_widget_unlock_accelerators</code></td>
 
286
</tr>
 
287
<tr>
 
288
<td><code class="function">gtk_widget_freeze_accelerators</code></td>
 
289
<td><code class="function">gtk_widget_lock_accelerators</code></td>
 
290
</tr>
 
291
</tbody>
 
292
</table></div>
 
293
<p>
 
294
 
 
295
Note that <code class="function">gtk_entry_adjust_scroll()</code> is no longer needed 
 
296
    as <span class="structname">GtkEntry</span> should automatically keep the scroll 
 
297
    adjusted properly.
 
298
</p>
 
299
</li>
 
300
<li><p>
 
301
Additionally, all <code class="function">gtk_*_interp()</code> functions were removed.
 
302
  <code class="function">gtk_*_full()</code> versions were provided as of GTK+ 1.0 and 
 
303
  should be used instead.
 
304
</p></li>
 
305
<li><p>
 
306
<span class="structname">GtkButton</span> has been changed to derive from 
 
307
<span class="structname">GtkBin</span>.
 
308
  To access a button's child, use <code class="literal">GTK_BIN (button)-&gt;child</code>,
 
309
  instead of the old <code class="literal">GTK_BUTTON (button)-&gt;child</code>.
 
310
</p></li>
 
311
<li>
 
312
<p>
 
313
The selection API has been slightly modified:
 
314
 
 
315
 <code class="function">gtk_selection_add_handler()</code> and 
 
316
 <code class="function">gtk_selection_add_handler_full()</code> 
 
317
 have been removed. To supply the selection, one now registers
 
318
 the targets one is interested in with:
 
319
 
 
320
</p>
 
321
<pre class="programlisting">
 
322
  void gtk_selection_add_target (GtkWidget           *widget, 
 
323
                                 GdkAtom              selection,
 
324
                                 GdkAtom              target,
 
325
                                 guint                info);
 
326
</pre>
 
327
<p>
 
328
 
 
329
 or:
 
330
  
 
331
</p>
 
332
<pre class="programlisting">
 
333
  void gtk_selection_add_targets (GtkWidget           *widget, 
 
334
                                  GdkAtom              selection,
 
335
                                  GtkTargetEntry      *targets,
 
336
                                  guint                ntargets);
 
337
</pre>
 
338
<p>
 
339
 
 
340
 When a request for a selection is received, the new "selection_get"
 
341
 signal will be called:
 
342
 
 
343
</p>
 
344
<pre class="programlisting">
 
345
   void  "selection_get"           (GtkWidget          *widget,
 
346
                                    GtkSelectionData   *selection_data,
 
347
                                    guint               info,
 
348
                                    guint               time);
 
349
</pre>
 
350
<p>
 
351
 
 
352
 A "time" parameter has also been added to the "selection_received"
 
353
 signal.
 
354
 
 
355
</p>
 
356
<pre class="programlisting">
 
357
  void  "selection_received"       (GtkWidget          *widget,
 
358
                                    GtkSelectionData   *selection_data,
 
359
                                    guint               time);
 
360
</pre>
 
361
<p>
 
362
</p>
 
363
</li>
 
364
<li><p>
 
365
The old drag and drop API has been completely removed and replaced.
 
366
  See the reference documentation for details on the new API.
 
367
</p></li>
 
368
<li>
 
369
<p>
 
370
Support for Themes has been added. In general, this does
 
371
  not affect application code, however, a few new rules should
 
372
  be observed:
 
373
 
 
374
  </p>
 
375
<div class="itemizedlist"><ul type="circle">
 
376
<li><p>To set a shape for a window, you must use 
 
377
     <code class="function">gtk_widget_shape_combine_mask()</code> instead of 
 
378
     <code class="function">gdk_window_shape_combine_mask()</code>, or the shape will be
 
379
     reset when switching themes.
 
380
  </p></li>
 
381
<li><p>It is no longer permissable to draw directly on an arbitrary
 
382
     widget, or to set an arbitrary widget's background pixmap.
 
383
     If you need to do that, use a <span class="structname">GtkDrawingArea</span> or 
 
384
     (for a toplevel) a <span class="structname">GtkWindow</span> where 
 
385
     <code class="function">gtk_widget_set_app_paintable()</code>
 
386
     has been called.
 
387
  </p></li>
 
388
</ul></div>
 
389
<p>
 
390
</p>
 
391
</li>
 
392
<li>
 
393
<p>
 
394
The <span class="structname">GtkScrolledWindow</span> widget no longer creates a 
 
395
  <span class="structname">GtkViewport</span> automatically. Instead, it has been 
 
396
  generalized to accept any "self-scrolling" widget.
 
397
</p>
 
398
<p>
 
399
  The self-scrolling widgets in the GTK+ core are 
 
400
  <span class="structname">GtkViewport</span>,
 
401
  <span class="structname">GtkCList</span>, <span class="structname">GtkCTree</span>, 
 
402
  <span class="structname">GtkText</span>, and <span class="structname">GtkLayout</span>. 
 
403
  All of these widgets can be added to a scrolled window as normal children with
 
404
  <code class="function">gtk_container_add()</code> and scrollbars will be set up 
 
405
  automatically.
 
406
</p>
 
407
<p>
 
408
  To add scrollbars to a non self-scrolling widget, (such as a 
 
409
  <span class="structname">GtkList</span>),
 
410
  first add it to a viewport, then add the viewport to a scrolled window.
 
411
  The scrolled window code provides a convenience function to do this:
 
412
 
 
413
</p>
 
414
<pre class="programlisting">
 
415
  void gtk_scrolled_window_add_with_viewport (GtkScrolledWindow *scrollwin,
 
416
                                              GtkWidget         *child);
 
417
</pre>
 
418
<p>
 
419
 
 
420
  This does exactly what it says - it creates a viewport, adds the child
 
421
  widget to it, then adds the viewport to the scrolled window.
 
422
</p>
 
423
<p>
 
424
  The scrollbars have been removed from the <span class="structname">GtkCList</span>
 
425
  and <span class="structname">GtkCTree</span>, because they are now scrolled by simply
 
426
  adding them to a scrolled window. The scrollbar policy is set on the scrolled
 
427
  window with <code class="function">gtk_scrolled_window_set_policy()</code> and not on 
 
428
  the child widgets (e.g. <span class="structname">GtkCList</span>'s 
 
429
  <code class="function">gtk_clist_set_policy()</code> was removed).
 
430
</p>
 
431
</li>
 
432
<li><p>
 
433
The "main loop" of GTK+ has been moved to GLib. This should not
 
434
  affect existing programs, since compatibility functions have
 
435
  been provided. However, you may want to consider migrating
 
436
  your code to use the GLib main loop directly.
 
437
</p></li>
 
438
<li><p>
 
439
the <code class="literal">GTK_BASIC</code> flag was removed, and with it the corresponding
 
440
  macro and function <code class="function">GTK_WIDGET_BASIC()</code> and 
 
441
  <code class="function">gtk_widget_basic()</code>.
 
442
</p></li>
 
443
<li>
 
444
<p>
 
445
All freeze/thaw methods are now recursive - that is, if you
 
446
  freeze a widget n times, you must also thaw it n times.
 
447
 
 
448
  Therefore, if you have code like:
 
449
 
 
450
</p>
 
451
<div class="informalexample"><pre class="programlisting">
 
452
  gboolean frozen;
 
453
  frozen = GTK_CLIST_FROZEN (clist);
 
454
  gtk_clist_freeze (clist);
 
455
  [...]
 
456
  if (!frozen)
 
457
    gtk_clist_thaw (clist);
 
458
</pre></div>
 
459
<p>
 
460
 
 
461
  it will not work anymore. It must be, simply:
 
462
 
 
463
</p>
 
464
<div class="informalexample"><pre class="programlisting">
 
465
  gtk_clist_freeze (clist);
 
466
  [...]
 
467
  gtk_clist_thaw (clist);
 
468
</pre></div>
 
469
<p>
 
470
</p>
 
471
</li>
 
472
<li>
 
473
<p>
 
474
The thread safety in GTK+ 1.2 is slightly different than
 
475
  that which appeared in early versions in the 1.1
 
476
  development track. The main difference is that it relies on 
 
477
  the thread primitives in GLib, and on the thread-safe 
 
478
  GLib main loop.
 
479
</p>
 
480
<p>
 
481
  This means:
 
482
 
 
483
</p>
 
484
<div class="itemizedlist"><ul type="circle">
 
485
<li><p>You must call <code class="function">g_thread_init()</code> before 
 
486
       executing any other GTK+ or GDK functions in a threaded GTK+ program.
 
487
     </p></li>
 
488
<li>
 
489
<p>Idles, timeouts, and input functions are executed outside 
 
490
       of the main GTK+ lock. So, if you need to call GTK+ 
 
491
       inside of such a callback, you must surround the callback
 
492
       with a <code class="function">gdk_threads_enter()</code>/<code class="function">gdk_threads_leave()</code> 
 
493
       pair.
 
494
     </p>
 
495
<p>However, signals are still executed within the main
 
496
       GTK+ lock.
 
497
     </p>
 
498
<p>In particular, this means, if you are writing widgets
 
499
       that might be used in threaded programs, you <span class="emphasis"><em>must</em></span>
 
500
       surround timeouts and idle functions in this matter.
 
501
     </p>
 
502
<p>As always, you must also surround any calls to GTK+
 
503
       not made within a signal handler with a 
 
504
       <code class="function">gdk_threads_enter()</code>/<code class="function">gdk_threads_leave()</code> 
 
505
       pair.
 
506
     </p>
 
507
</li>
 
508
<li>
 
509
<p>There is no longer a special <code class="option">--with-threads</code> 
 
510
       <span><strong class="command">configure</strong></span> option for GTK+. To use threads in a GTK+ 
 
511
       program, you must:
 
512
 
 
513
       </p>
 
514
<div class="orderedlist"><ol type="1">
 
515
<li><p>If you want to use the native thread implementation,
 
516
              make sure GLib found this in configuration, otherwise,
 
517
              call you must provide a thread implementation to
 
518
              <code class="function">g_thread_init()</code>.
 
519
           </p></li>
 
520
<li><p>Link with the libraries returned by
 
521
             <span><strong class="command">gtk-config --libs gthread</strong></span>
 
522
             and use the cflags from
 
523
             <span><strong class="command">gtk-config --cflags gthread</strong></span>.
 
524
             You can get these <code class="envar">CFLAGS</code> and <code class="envar">LIBS</code> by 
 
525
             passing <code class="literal">gthread</code> as the fourth parameter to the 
 
526
             <code class="literal">AM_PATH_GTK</code> <span class="application">automake</span>
 
527
             macro.
 
528
           </p></li>
 
529
</ol></div>
 
530
<p>
 
531
     </p>
 
532
</li>
 
533
</ul></div>
 
534
<p>
 
535
</p>
 
536
</li>
 
537
<li>
 
538
<p>
 
539
Prior to GTK+ 1.2, there were two conflicting interpretations
 
540
  of <code class="literal">widget-&gt;requisition</code>. It was either taken to be
 
541
  the size that the widget requested, or that size modified by calls to 
 
542
  <code class="function">gtk_widget_set_usize()</code>. In GTK+ 1.2,
 
543
  it is always interpreted the first way.
 
544
</p>
 
545
<p>
 
546
  Container widgets are affected in two ways by this:
 
547
 
 
548
  </p>
 
549
<div class="orderedlist"><ol type="1">
 
550
<li>
 
551
<p>Container widgets should not pass 
 
552
        <code class="literal">widget-&gt;requisition</code> as the second parameter to 
 
553
        <code class="function">gtk_widget_size_request()</code>.
 
554
        Instead they should call it like:
 
555
        </p>
 
556
<pre class="programlisting">
 
557
          GtkRequisition child_requisition;
 
558
          gtk_widget_size_request (widget, &amp;child_requisition);
 
559
        </pre>
 
560
<p>
 
561
      </p>
 
562
</li>
 
563
<li>
 
564
<p>Container widgets should not access 
 
565
        <code class="literal">child-&gt;requisition</code> directly. Either they should use 
 
566
        the values returned by <code class="function">gtk_widget_size_request()</code>, 
 
567
        or they should call the new function:
 
568
        </p>
 
569
<pre class="programlisting">
 
570
    void gtk_widget_get_child_requisition (GtkWidget      *widget,
 
571
                                           GtkRequisition *requisition);
 
572
        </pre>
 
573
<p>
 
574
        which returns the requisition of the given widget, modified
 
575
        by calls to <code class="function">gtk_widget_set_usize()</code>.
 
576
      </p>
 
577
</li>
 
578
</ol></div>
 
579
<p>
 
580
</p>
 
581
</li>
 
582
</ul></div>
 
583
</div>
 
584
</div>
 
585
</body>
 
586
</html>