📄 gtk-changes-1-2.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"><title>Changes from 1.0 to 1.2</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="GTK+ Reference Manual"><link rel="up" href="migrating.html" title="Part IV. Migrating from Previous Versions of GTK+"><link rel="prev" href="checklist-named-icons.html" title="Use named icons"><link rel="next" href="gtk-changes-2-0.html" title="Changes from 1.2 to 2.0"><meta name="generator" content="GTK-Doc V1.9 (XML mode)"><link rel="stylesheet" href="style.css" type="text/css"><link rel="part" href="gtk.html" title="Part I. GTK+ Overview"><link rel="part" href="gtkbase.html" title="Part II. GTK+ Core Reference"><link rel="part" href="gtkobjects.html" title="Part III. GTK+ Widgets and Objects"><link rel="chapter" href="ch01.html" title="Object Hierarchy"><link rel="chapter" href="ch02.html" title="Widget Gallery"><link rel="chapter" href="WindowWidgets.html" title="Windows"><link rel="chapter" href="DisplayWidgets.html" title="Display Widgets"><link rel="chapter" href="ButtonWidgets.html" title="Buttons and Toggles"><link rel="chapter" href="NumericEntry.html" title="Numeric/Text Data Entry"><link rel="chapter" href="TextWidgetObjects.html" title="Multiline Text Editor"><link rel="chapter" href="TreeWidgetObjects.html" title="Tree, List and Icon Grid Widgets"><link rel="chapter" href="MenusAndCombos.html" title="Menus, Combo Box, Toolbar"><link rel="chapter" href="Actions.html" title="Action-based menus and toolbars"><link rel="chapter" href="SelectorWidgets.html" title="Selectors (File/Font/Color/Input Devices)"><link rel="chapter" href="LayoutContainers.html" title="Layout Containers"><link rel="chapter" href="Ornaments.html" title="Ornaments"><link rel="chapter" href="ScrollingWidgets.html" title="Scrolling"><link rel="chapter" href="Printing.html" title="Printing"><link rel="chapter" href="MiscObjects.html" title="Miscellaneous"><link rel="chapter" href="AbstractObjects.html" title="Abstract Base Classes"><link rel="chapter" href="PlugSocket.html" title="Cross-process Embedding"><link rel="chapter" href="SpecialObjects.html" title="Special-purpose features"><link rel="chapter" href="RecentDocuments.html" title="Recently Used Documents"><link rel="chapter" href="Builder.html" title="Interface builder"><link rel="chapter" href="DeprecatedObjects.html" title="Deprecated"><link rel="part" href="migrating.html" title="Part IV. Migrating from Previous Versions of GTK+"><link rel="chapter" href="gtk-migrating-checklist.html" title="Migration Checklist"><link rel="chapter" href="gtk-migrating-GtkFileChooser.html" title="Migrating from GtkFileSelection to GtkFileChooser"><link rel="chapter" href="gtk-migrating-GtkAction.html" title="Migrating from old menu and toolbar systems to GtkAction"><link rel="chapter" href="gtk-migrating-GtkComboBox.html" title="Migrating from GtkOptionMenu and GtkCombo to GtkComboBox and GtkComboBoxEntry"><link rel="chapter" href="gtk-migrating-GtkIconView.html" title="Migrating from GnomeIconList to GtkIconView"><link rel="chapter" href="gtk-migrating-GtkAboutDialog.html" title="Migrating from GnomeAbout to GtkAboutDialog"><link rel="chapter" href="gtk-migrating-GtkColorButton.html" title="Migrating from GnomeColorPicker to GtkColorButton"><link rel="chapter" href="gtk-migrating-GtkAssistant.html" title="Migrating from GnomeDruid to GtkAssistant"><link rel="chapter" href="gtk-migrating-GtkRecentChooser.html" title="Migrating from EggRecent to GtkRecentChooser"><link rel="chapter" href="gtk-migrating-GtkLinkButton.html" title="Migrating from GnomeHRef to GtkLinkButton"><link rel="chapter" href="gtk-migrating-GtkBuilder.html" title="Migrating from libglade to GtkBuilder"><link rel="chapter" href="gtk-migrating-tooltips.html" title="Migrating from GtkTooltips to GtkTooltip"><link rel="part" href="pt05.html" title="Part V. GTK+ Tools"><link rel="glossary" href="glossary.html" title="Glossary"><link rel="index" href="ix01.html" title="Index"><link rel="index" href="ix02.html" title="Index of deprecated symbols"><link rel="index" href="ix03.html" title="Index of new symbols in 2.2"><link rel="index" href="ix04.html" title="Index of new symbols in 2.4"><link rel="index" href="ix05.html" title="Index of new symbols in 2.6"><link rel="index" href="ix06.html" title="Index of new symbols in 2.8"><link rel="index" href="ix07.html" title="Index of new symbols in 2.10"><link rel="index" href="ix08.html" title="Index of new symbols in 2.12"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="checklist-named-icons.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="migrating.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td><th width="100%" align="center">GTK+ Reference Manual</th><td><a accesskey="n" href="gtk-changes-2-0.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr></table><div class="refentry" lang="en"><a name="gtk-changes-1-2"></a><div class="titlepage"></div><div class="refnamediv"><table width="100%"><tr><td valign="top"><h2><span class="refentrytitle">Changes from 1.0 to 1.2</span></h2><p>Changes from 1.0 to 1.2 — Incompatible changes made between version 1.0 and version 1.2</p></td><td valign="top" align="right"></td></tr></table></div><div class="refsect1" lang="en"><a name="id4604904"></a><h2>Incompatible changes from 1.0 to 1.2</h2><div class="itemizedlist"><ul type="disc"><li><p><span class="structname">GtkAcceleratorTable</span> has been replaced with <span class="structname">GtkAccelGroup</span>.</p></li><li><p><span class="structname">GtkMenuFactory</span> has been replaced with <span class="structname">GtkItemFactory</span>, althougha version of <span class="structname">GtkMenuFactory</span> is currently still provided to ease the migration phase.</p></li><li><p>The <span class="structname">GtkTypeInfo</span> structures used in the <code class="function">gtk_*_type_init()</code> functions havechanged a bit, the old format:</p><pre class="programlisting"> GtkTypeInfo bin_info = { "GtkBin", sizeof (GtkBin), sizeof (GtkBinClass), (GtkClassInitFunc) gtk_bin_class_init, (GtkObjectInitFunc) gtk_bin_init, (GtkArgSetFunc) NULL, (GtkArgGetFunc) NULL, };</pre><p> needs to be converted to:</p><pre class="programlisting"> static const GtkTypeInfo bin_info = { "GtkBin", sizeof (GtkBin), sizeof (GtkBinClass), (GtkClassInitFunc) gtk_bin_class_init, (GtkObjectInitFunc) gtk_bin_init, /* reserved_1 */ NULL, /* reserved_2 */ NULL, (GtkClassInitFunc) NULL, };</pre><p> the <code class="function">GtkArgSetFunc</code> and <code class="function">GtkArgGetFunc</code> functions are not supported from the type system anymore, and you should make sure that your code only fills in these fields with <code class="literal">NULL</code> and doesn't use the deprecated function typedefs <code class="literal">(GtkArgSetFunc)</code> and <code class="literal">(GtkArgGetFunc)</code> anymore.</p></li><li><p>A number of GTK+ functions were renamed. For compatibility, <code class="filename">gtkcompat.h</code> #define's the old 1.0.x function names in terms of the new names. To assure your GTK+ program doesn't rely on outdated function variants, compile your program with <code class="option">-DGTK_DISABLE_COMPAT_H</code> to disable the compatibility aliases. Here is the list of the old names and replacements:</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Old</th><th>Replacement</th></tr></thead><tbody><tr><td><code class="function">gtk_accel_label_accelerator_width</code></td><td><code class="function">gtk_accel_label_get_accel_width</code></td></tr><tr><td><code class="function">gtk_check_menu_item_set_state</code></td><td><code class="function">gtk_check_menu_item_set_active</code></td></tr><tr><td><code class="function">gtk_container_border_width</code></td><td><code class="function">gtk_container_set_border_width</code></td></tr><tr><td><code class="function">gtk_label_set</code></td><td><code class="function">gtk_label_set_text</code></td></tr><tr><td><code class="function">gtk_notebook_current_page</code></td><td><code class="function">gtk_notebook_get_current_page</code></td></tr><tr><td><code class="function">gtk_packer_configure</code></td><td><code class="function">gtk_packer_set_child_packing</code></td></tr><tr><td><code class="function">gtk_paned_gutter_size</code></td><td><code class="function">gtk_paned_set_gutter_size</code></td></tr><tr><td><code class="function">gtk_paned_handle_size</code></td><td><code class="function">gtk_paned_set_handle_size</code></td></tr><tr><td><code class="function">gtk_scale_value_width</code></td><td><code class="function">gtk_scale_get_value_width</code></td></tr><tr><td><code class="function">gtk_style_apply_default_pixmap</code></td><td><code class="function">gtk_style_apply_default_background</code></td></tr><tr><td><code class="function">gtk_toggle_button_set_state</code></td><td><code class="function">gtk_toggle_button_set_active</code></td></tr><tr><td><code class="function">gtk_window_position</code></td><td><code class="function">gtk_window_set_position</code></td></tr></tbody></table></div><p> Note that <code class="function">gtk_style_apply_default_background()</code> has an additional argument, <code class="literal">set_bg</code>. This parameter should be <code class="literal">FALSE</code> if the background is being set for a <code class="literal">NO_WINDOW</code> widget, otherwise <code class="literal">TRUE</code>.</p></li><li><p>During the development phase of the 1.1.x line of GTK+ certain functions were deprecated and later removed. Functions affected are:</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Removed</th><th>Replacement</th></tr></thead><tbody><tr><td><code class="function">gtk_clist_set_border</code></td><td><code class="function">gtk_clist_set_shadow_type</code></td></tr><tr><td><code class="function">gtk_container_block_resize</code></td><td><code class="function">gtk_container_set_resize_mode</code></td></tr><tr><td><code class="function">gtk_container_unblock_resize</code></td><td><code class="function">gtk_container_set_resize_mode</code></td></tr><tr><td><code class="function">gtk_container_need_resize</code></td><td><code class="function">gtk_container_check_resize</code></td></tr><tr><td><code class="function">gtk_ctree_show_stub</code></td><td><code class="function">gtk_ctree_set_show_stub</code></td></tr><tr><td><code class="function">gtk_ctree_set_reorderable</code></td><td><code class="function">gtk_clist_set_reorderable</code></td></tr><tr><td><code class="function">gtk_ctree_set_use_drag_icons</code></td><td><code class="function">gtk_clist_set_use_drag_icons</code></td></tr><tr><td><code class="function">gtk_entry_adjust_scroll</code></td><td><code class="function">-</code></td></tr><tr><td><code class="function">gtk_object_class_add_user_signal</code></td><td><code class="function">gtk_object_class_user_signal_new</code></td></tr><tr><td><code class="function">gtk_preview_put_row</code></td><td><code class="function">gtk_preview_put</code></td></tr><tr><td><code class="function">gtk_progress_bar_construct</code></td><td><code class="function">gtk_progress_set_adjustment</code></td></tr><tr><td><code class="function">gtk_scrolled_window_construct</code></td><td><code class="function">gtk_scrolled_window_set_{h|v}adjustment</code></td></tr><tr><td><code class="function">gtk_spin_button_construct</code></td><td><code class="function">gtk_spin_button_configure</code></td></tr><tr><td><code class="function">gtk_widget_thaw_accelerators</code></td><td><code class="function">gtk_widget_unlock_accelerators</code></td></tr><tr><td><code class="function">gtk_widget_freeze_accelerators</code></td><td><code class="function">gtk_widget_lock_accelerators</code></td></tr></tbody></table></div>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -