⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 changes-1.2.sgml

📁 This GTK+ version 2.12.3. GTK+ is a multi-platform toolkit for creating graphical user interfaces.
💻 SGML
📖 第 1 页 / 共 2 页
字号:
<refentry id="gtk-changes-1-2" revision="1 Jan 2002"><refmeta><refentrytitle>Changes from 1.0 to 1.2</refentrytitle><manvolnum>3</manvolnum><refmiscinfo>Changes from 1.0 to 1.2</refmiscinfo></refmeta><refnamediv><refname>Changes from 1.0 to 1.2</refname><refpurpose>Incompatible changes made between version 1.0 and version 1.2</refpurpose></refnamediv><refsect1><title>Incompatible changes from 1.0 to 1.2</title><itemizedlist><listitem><para><structname>GtkAcceleratorTable</structname> has been replaced with <structname>GtkAccelGroup</structname>.</para></listitem><listitem><para><structname>GtkMenuFactory</structname> has been replaced with <structname>GtkItemFactory</structname>, althougha version of <structname>GtkMenuFactory</structname> is currently still provided to ease the migration phase.</para></listitem><listitem><para>The <structname>GtkTypeInfo</structname> structures used in the <function>gtk_*_type_init()</function> functions havechanged a bit, the old format:<programlisting>      GtkTypeInfo bin_info =      {        "GtkBin",        sizeof (GtkBin),        sizeof (GtkBinClass),        (GtkClassInitFunc) gtk_bin_class_init,        (GtkObjectInitFunc) gtk_bin_init,        (GtkArgSetFunc) NULL,        (GtkArgGetFunc) NULL,      };</programlisting>  needs to be converted to:<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,      };</programlisting>  the <function>GtkArgSetFunc</function> and <function>GtkArgGetFunc</function>  functions are not supported from the type system anymore, and you should make  sure that your code only fills in these fields with <literal>NULL</literal>   and doesn't use the deprecated function typedefs   <literal>(GtkArgSetFunc)</literal> and <literal>(GtkArgGetFunc)</literal>   anymore.</para></listitem><listitem><para>A number of GTK+ functions were renamed. For compatibility,   <filename>gtkcompat.h</filename> #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   <option>-DGTK_DISABLE_COMPAT_H</option> to disable  the compatibility aliases.  Here is the list of the old names and replacements:<informaltable><tgroup cols="2"><thead><row><entry>Old</entry><entry>Replacement</entry></row></thead><tbody><row><entry><function>gtk_accel_label_accelerator_width</function></entry><entry><function>gtk_accel_label_get_accel_width</function></entry></row><row><entry><function>gtk_check_menu_item_set_state</function></entry><entry><function>gtk_check_menu_item_set_active</function></entry></row><row><entry><function>gtk_container_border_width</function></entry><entry><function>gtk_container_set_border_width</function></entry></row><row><entry><function>gtk_label_set</function></entry><entry><function>gtk_label_set_text</function></entry></row><row><entry><function>gtk_notebook_current_page</function></entry><entry><function>gtk_notebook_get_current_page</function></entry></row><row><entry><function>gtk_packer_configure</function></entry><entry><function>gtk_packer_set_child_packing</function></entry></row><row><entry><function>gtk_paned_gutter_size</function></entry><entry><function>gtk_paned_set_gutter_size</function></entry></row><row><entry><function>gtk_paned_handle_size</function></entry><entry><function>gtk_paned_set_handle_size</function></entry></row><row><entry><function>gtk_scale_value_width</function></entry><entry><function>gtk_scale_get_value_width</function></entry></row><row><entry><function>gtk_style_apply_default_pixmap</function></entry><entry><function>gtk_style_apply_default_background</function></entry></row><row><entry><function>gtk_toggle_button_set_state</function></entry><entry><function>gtk_toggle_button_set_active</function></entry></row><row><entry><function>gtk_window_position</function></entry><entry><function>gtk_window_set_position</function></entry></row></tbody></tgroup></informaltable> Note that <function>gtk_style_apply_default_background()</function> has an       additional argument, <literal>set_bg</literal>. This parameter should be       <literal>FALSE</literal> if the background is being set for a       <literal>NO_WINDOW</literal> widget, otherwise <literal>TRUE</literal>.</para></listitem><listitem><para>During the development phase of the 1.1.x line of GTK+ certain functions  were deprecated and later removed. Functions affected are:<informaltable><tgroup cols="2"><thead><row><entry>Removed</entry><entry>Replacement</entry></row></thead><tbody><row><entry><function>gtk_clist_set_border</function></entry><entry><function>gtk_clist_set_shadow_type</function></entry></row><row><entry><function>gtk_container_block_resize</function></entry><entry><function>gtk_container_set_resize_mode</function></entry></row><row><entry><function>gtk_container_unblock_resize</function></entry><entry><function>gtk_container_set_resize_mode</function></entry></row><row><entry><function>gtk_container_need_resize</function></entry><entry><function>gtk_container_check_resize</function></entry></row><row><entry><function>gtk_ctree_show_stub</function></entry><entry><function>gtk_ctree_set_show_stub</function></entry></row><row><entry><function>gtk_ctree_set_reorderable</function></entry><entry><function>gtk_clist_set_reorderable</function></entry></row><row><entry><function>gtk_ctree_set_use_drag_icons</function></entry><entry><function>gtk_clist_set_use_drag_icons</function></entry></row><row><entry><function>gtk_entry_adjust_scroll</function></entry><entry><function>-</function></entry></row><row><entry><function>gtk_object_class_add_user_signal</function></entry><entry><function>gtk_object_class_user_signal_new</function></entry></row><row><entry><function>gtk_preview_put_row</function></entry><entry><function>gtk_preview_put</function></entry></row><row><entry><function>gtk_progress_bar_construct</function></entry><entry><function>gtk_progress_set_adjustment</function></entry></row><row><entry><function>gtk_scrolled_window_construct</function></entry><entry><function>gtk_scrolled_window_set_{h|v}adjustment</function></entry></row><row><entry><function>gtk_spin_button_construct</function></entry><entry><function>gtk_spin_button_configure</function></entry></row><row><entry><function>gtk_widget_thaw_accelerators</function></entry><entry><function>gtk_widget_unlock_accelerators</function></entry></row><row><entry><function>gtk_widget_freeze_accelerators</function></entry><entry><function>gtk_widget_lock_accelerators</function></entry></row></tbody></tgroup></informaltable>Note that <function>gtk_entry_adjust_scroll()</function> is no longer needed     as <structname>GtkEntry</structname> should automatically keep the scroll     adjusted properly.</para></listitem><listitem><para>Additionally, all <function>gtk_*_interp()</function> functions were removed.  <function>gtk_*_full()</function> versions were provided as of GTK+ 1.0 and   should be used instead.</para></listitem><listitem><para><structname>GtkButton</structname> has been changed to derive from <structname>GtkBin</structname>.  To access a button's child, use <literal>GTK_BIN (button)-&gt;child</literal>,  instead of the old <literal>GTK_BUTTON (button)-&gt;child</literal>.</para></listitem><listitem><para>The selection API has been slightly modified: <function>gtk_selection_add_handler()</function> and  <function>gtk_selection_add_handler_full()</function>  have been removed. To supply the selection, one now registers the targets one is interested in with:<programlisting>  void gtk_selection_add_target (GtkWidget           *widget, 	  	                 GdkAtom              selection,			         GdkAtom              target,			         guint                info);</programlisting> or:  <programlisting>  void gtk_selection_add_targets (GtkWidget           *widget, 	  			  GdkAtom              selection,				  GtkTargetEntry      *targets,				  guint                ntargets);</programlisting> When a request for a selection is received, the new "selection_get" signal will be called:<programlisting>   void  "selection_get"           (GtkWidget          *widget,				    GtkSelectionData   *selection_data,				    guint               info,				    guint               time);</programlisting> A "time" parameter has also been added to the "selection_received" signal.<programlisting>  void  "selection_received"       (GtkWidget          *widget,				    GtkSelectionData   *selection_data,				    guint               time);</programlisting></para></listitem><listitem><para>The old drag and drop API has been completely removed and replaced.  See the reference documentation for details on the new API.</para></listitem><listitem><para>Support for Themes has been added. In general, this does  not affect application code, however, a few new rules should  be observed:

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -