Some cleanups
2007-05-26 Matthias Clasen <mclasen@redhat.com> * gtk/migrating*.sgml: Some cleanups svn path=/trunk/; revision=17948
This commit is contained in:
		
				
					committed by
					
						
						Matthias Clasen
					
				
			
			
				
	
			
			
			
						parent
						
							2572a17fd8
						
					
				
				
					commit
					324b853954
				
			@ -1,3 +1,7 @@
 | 
			
		||||
2007-05-26   Matthias Clasen  <mclasen@redhat.com>
 | 
			
		||||
 | 
			
		||||
	* gtk/migrating*.sgml: Some cleanups
 | 
			
		||||
 | 
			
		||||
2007-05-26   Matthias Clasen  <mclasen@redhat.com>
 | 
			
		||||
 | 
			
		||||
	* gtk/tmpl/gtkentry.sgml: Move docs inline
 | 
			
		||||
 | 
			
		||||
@ -3,8 +3,9 @@
 | 
			
		||||
  <title>Migrating from GnomeAbout to GtkAboutDialog</title>
 | 
			
		||||
 | 
			
		||||
  <para>
 | 
			
		||||
    Since version 2.6, GTK+ provides the #GtkAboutDialog widget as a replacement for 
 | 
			
		||||
    the <structname>GnomeAbout</structname> dialog in the libgnomeui library.
 | 
			
		||||
    Since version 2.6, GTK+ provides the #GtkAboutDialog widget as a 
 | 
			
		||||
    replacement for the <structname>GnomeAbout</structname> dialog in 
 | 
			
		||||
    the libgnomeui library.
 | 
			
		||||
  </para>
 | 
			
		||||
 | 
			
		||||
  <para>
 | 
			
		||||
@ -66,17 +67,15 @@
 | 
			
		||||
    <itemizedlist>
 | 
			
		||||
      <listitem><para>
 | 
			
		||||
        You can specify license information with the 
 | 
			
		||||
        <link linkend="GtkAboutDialog--license">license</link> property
 | 
			
		||||
        #GtkAboutDialog:license property
 | 
			
		||||
      </para></listitem>
 | 
			
		||||
      <listitem><para>
 | 
			
		||||
        You can add separate credits for artists with the 
 | 
			
		||||
        <link linkend="GtkAboutDialog--artists">artists</link> property
 | 
			
		||||
        #GtkAboutDialog:artists property
 | 
			
		||||
      </para></listitem>
 | 
			
		||||
      <listitem><para>
 | 
			
		||||
        You can add a pointer to the website of your application, using the 
 | 
			
		||||
        <link linkend="GtkAboutDialog--website">website</link> and
 | 
			
		||||
        <link linkend="GtkAboutDialog--website-label">website-label</link> 
 | 
			
		||||
        properties.
 | 
			
		||||
        #GtkAboutDialog:website and #GtkAboutDialog:website-label properties.
 | 
			
		||||
      </para></listitem>
 | 
			
		||||
      <listitem><para>
 | 
			
		||||
        If your credits contain email addresses or URLs, you can turn them 
 | 
			
		||||
 | 
			
		||||
@ -52,8 +52,8 @@
 | 
			
		||||
 | 
			
		||||
    <para>
 | 
			
		||||
      Normal actions are simply commands, such as
 | 
			
		||||
      <symbol>FileSave</symbol> or <symbol>EditCopy</symbol>.  Toggle
 | 
			
		||||
      actions can be active or inactive, such as
 | 
			
		||||
      <symbol>FileSave</symbol> or <symbol>EditCopy</symbol>.  
 | 
			
		||||
      Toggle actions can be active or inactive, such as
 | 
			
		||||
      <symbol>FormatBold</symbol> or <symbol>ViewShowRulers</symbol>.
 | 
			
		||||
      Radio actions define a set of items for which one and only one
 | 
			
		||||
      can be active at a time, for example, {
 | 
			
		||||
@ -105,8 +105,8 @@
 | 
			
		||||
      pass back pointers to the widgets that got created.  This means
 | 
			
		||||
      that the structures cannot simply be kept around if the program
 | 
			
		||||
      requires multiple instances of the user interface (e.g. several
 | 
			
		||||
      windows); each new invocation of gnome_app_fill_menu() would overwrite the
 | 
			
		||||
      widget fields of the structures.
 | 
			
		||||
      windows); each new invocation of gnome_app_fill_menu() would 
 | 
			
		||||
      overwrite the widget fields of the structures.
 | 
			
		||||
    </para>
 | 
			
		||||
 | 
			
		||||
    <para>
 | 
			
		||||
@ -135,15 +135,16 @@
 | 
			
		||||
	  actions, toggle actions, and radio actions, and then create
 | 
			
		||||
	  a separate array of #GtkActionEntry structures
 | 
			
		||||
	  for each group.  This will allow you to create the necessary
 | 
			
		||||
	  #GtkActionGroup objects.  Note that this does not describe the actual
 | 
			
		||||
	  "shape" that your menus and toolbars will have; it simply
 | 
			
		||||
	  defines the set of commands that will appear in them.
 | 
			
		||||
	  #GtkActionGroup objects.  Note that this does not describe 
 | 
			
		||||
          the actual "shape" that your menus and toolbars will have; 
 | 
			
		||||
          it simply defines the set of commands that will appear in them.
 | 
			
		||||
	</para>
 | 
			
		||||
      </listitem>
 | 
			
		||||
      <listitem>
 | 
			
		||||
	<para>
 | 
			
		||||
	  Create an XML description of your menus and toolbars for use
 | 
			
		||||
	  with #GtkUIManager.  This defines the actual shape of the menus and toolbars.
 | 
			
		||||
	  with #GtkUIManager.  This defines the actual shape of the menus 
 | 
			
		||||
          and toolbars.
 | 
			
		||||
	</para>
 | 
			
		||||
      </listitem>
 | 
			
		||||
      <listitem>
 | 
			
		||||
@ -156,9 +157,10 @@
 | 
			
		||||
       <para>
 | 
			
		||||
         If your GnomeUIInfo entries use GNOME_APP_PIXMAP_DATA or 
 | 
			
		||||
         GNOME_APP_PIXMAP_FILENAME for pixmaps, you have to create a 
 | 
			
		||||
         #GtkIconFactory, add it to the list of default factories, then create a 
 | 
			
		||||
         #GtkIconSet for each of your own icons. Add the sets to the factory, and 
 | 
			
		||||
         use the id in the #GtkActionEntry like a regular GTK+ stock id.
 | 
			
		||||
         #GtkIconFactory, add it to the list of default factories, then 
 | 
			
		||||
         create a #GtkIconSet for each of your own icons. Add the sets to 
 | 
			
		||||
         the factory, and use the id in the #GtkActionEntry like a regular 
 | 
			
		||||
         GTK+ stock id.
 | 
			
		||||
       </para>
 | 
			
		||||
      </listitem>
 | 
			
		||||
    </orderedlist>
 | 
			
		||||
@ -168,8 +170,8 @@
 | 
			
		||||
 | 
			
		||||
      <para>
 | 
			
		||||
	The following code shows a declaration of a simple menu bar to
 | 
			
		||||
	be used with gnome_app_fill_menu() or similar.  The menu hierarchy looks 
 | 
			
		||||
        like this:
 | 
			
		||||
	be used with gnome_app_fill_menu() or similar.  The menu hierarchy i
 | 
			
		||||
        looks like this:
 | 
			
		||||
      </para>
 | 
			
		||||
 | 
			
		||||
      <itemizedlist>
 | 
			
		||||
 | 
			
		||||
@ -15,13 +15,15 @@
 | 
			
		||||
 | 
			
		||||
  <para>
 | 
			
		||||
    Since version 2.10, GTK+ provides the GtkAssistant widget as a replacement
 | 
			
		||||
    for the <structname>GnomeDruid</structname> widget in the libgnomeui library.
 | 
			
		||||
    for the <structname>GnomeDruid</structname> widget in the libgnomeui 
 | 
			
		||||
    library.
 | 
			
		||||
  </para>
 | 
			
		||||
 | 
			
		||||
  <para>
 | 
			
		||||
    Conceptually, both <structname>GtkAssistant</structname> and <structname>GnomeDruid</structname>
 | 
			
		||||
    do the same task, but there are several areas where the API has been completely
 | 
			
		||||
    redesigned, so this chapter covers the main changes between both widgets.
 | 
			
		||||
    Conceptually, both <structname>GtkAssistant</structname> and
 | 
			
		||||
    <structname>GnomeDruid</structname> do the same task, but there are 
 | 
			
		||||
    several areas where the API has been completely redesigned, so this 
 | 
			
		||||
    chapter covers the main changes between both widgets.
 | 
			
		||||
  </para>
 | 
			
		||||
 | 
			
		||||
  <section id="inserting-pages">
 | 
			
		||||
@ -29,10 +31,12 @@
 | 
			
		||||
 | 
			
		||||
    <para>
 | 
			
		||||
      <structname>GnomeDruid</structname> was implemented as a container for
 | 
			
		||||
	 <structname>GnomeDruidPage</structname> abstract objects, which are implemented by the
 | 
			
		||||
	 <structname>GnomeDruidPageEdge</structname> and <structname>GnomeDruidPageStandard</structname>
 | 
			
		||||
	 widgets. Instead, <structname>GtkAssistant</structname> allows any widget to be a page, and implements
 | 
			
		||||
	 per-page settings (such as page type or title) as child properties. So instead of:
 | 
			
		||||
	 <structname>GnomeDruidPage</structname> abstract objects, which are
 | 
			
		||||
         implemented by the <structname>GnomeDruidPageEdge</structname> and 
 | 
			
		||||
         <structname>GnomeDruidPageStandard</structname> widgets. Instead, 
 | 
			
		||||
         <structname>GtkAssistant</structname> allows any widget to be a page, 
 | 
			
		||||
         and implements per-page settings (such as page type or title) as 
 | 
			
		||||
         child properties. So instead of:
 | 
			
		||||
    </para>
 | 
			
		||||
 | 
			
		||||
    <programlisting>
 | 
			
		||||
 | 
			
		||||
@ -16,8 +16,7 @@
 | 
			
		||||
    editable case. 
 | 
			
		||||
    The selection of the display style — menu or list —
 | 
			
		||||
    is no longer done at the API level, but has been made themeable via
 | 
			
		||||
    the style property 
 | 
			
		||||
    <link linkend="GtkComboBox--appearance">GtkComboBox::appearance</link>.
 | 
			
		||||
    the style property #GtkComboBox:appearance.
 | 
			
		||||
  </para>
 | 
			
		||||
 | 
			
		||||
  <section id="migrating-GtkOptionMenu">
 | 
			
		||||
 | 
			
		||||
@ -22,11 +22,9 @@
 | 
			
		||||
    </formalpara>
 | 
			
		||||
 | 
			
		||||
    <para>
 | 
			
		||||
      The <link
 | 
			
		||||
      linkend="GtkWidget-popup-menu">GtkWidget::popup_menu</link>
 | 
			
		||||
      signal instructs the widget for which it is emitted to create a
 | 
			
		||||
      context-sensitive popup menu.  By default, the <link
 | 
			
		||||
      linkend="gtk-bindings">key binding mechanism</link> is set to
 | 
			
		||||
      The #GtkWidget::popup_menu signal instructs the widget for which 
 | 
			
		||||
      it is emitted to create a context-sensitive popup menu. By default, 
 | 
			
		||||
      the <link linkend="gtk-bindings">key binding mechanism</link> is set to
 | 
			
		||||
      emit this signal when the
 | 
			
		||||
      <keycombo><keycap>Shift</keycap><keycap>F10</keycap></keycombo>
 | 
			
		||||
      or <keycap>Menu</keycap> keys are pressed while a widget has the
 | 
			
		||||
@ -77,8 +75,8 @@ do_popup_menu (GtkWidget *my_widget, GdkEventButton *event)
 | 
			
		||||
 | 
			
		||||
      <listitem>
 | 
			
		||||
	<para>
 | 
			
		||||
	  In your button_press handler, call this function when you
 | 
			
		||||
	  need to pop up a menu:
 | 
			
		||||
	  In your ::button-press handler, call this function 
 | 
			
		||||
          when you need to pop up a menu:
 | 
			
		||||
	</para>
 | 
			
		||||
 | 
			
		||||
	<programlisting>
 | 
			
		||||
@ -99,7 +97,7 @@ my_widget_button_press_event_handler (GtkWidget *widget, GdkEventButton *event)
 | 
			
		||||
 | 
			
		||||
      <listitem>
 | 
			
		||||
	<para>
 | 
			
		||||
	  Implement a handler for the popup_menu signal:
 | 
			
		||||
	  Implement a handler for the ::popup-menu signal:
 | 
			
		||||
	</para>
 | 
			
		||||
 | 
			
		||||
	<programlisting>
 | 
			
		||||
@ -231,14 +229,14 @@ my_widget_expose_event_handler (GtkWidget *widget, GdkEventExpose *event)
 | 
			
		||||
      <structfield>state</structfield> field is a bit mask which
 | 
			
		||||
      indicates the modifier state at the time the key was pressed.
 | 
			
		||||
      Modifiers are keys like <keycap>Control</keycap> and
 | 
			
		||||
      <keycap>NumLock</keycap>.  When implementing a <link
 | 
			
		||||
      linkend="GtkWidget-key-press-event">GtkWidget::key_press_event</link>
 | 
			
		||||
      handler, you should use gtk_accelerator_get_default_mod_mask() to
 | 
			
		||||
      <keycap>NumLock</keycap>.  When implementing a 
 | 
			
		||||
      #GtkWidget::key_press_event handler, you should use 
 | 
			
		||||
      gtk_accelerator_get_default_mod_mask() to
 | 
			
		||||
      test against modifier keys.  This function returns a bit mask
 | 
			
		||||
      which encompasses all the modifiers which the user may be
 | 
			
		||||
      actively pressing, such as <keycap>Control</keycap>,
 | 
			
		||||
      <keycap>Shift</keycap>, and <keycap>Alt</keycap>, but ignores
 | 
			
		||||
      "inocuous" modifiers such as <keycap>NumLock</keycap> and
 | 
			
		||||
      "innocuous" modifiers such as <keycap>NumLock</keycap> and
 | 
			
		||||
      <keycap>CapsLock</keycap>.
 | 
			
		||||
    </para>
 | 
			
		||||
 | 
			
		||||
@ -300,8 +298,7 @@ my_widget_key_press_event_handler (GtkWidget *widget, GdkEventKey *event)
 | 
			
		||||
      gtk_window_set_icon_name()) and images (see gtk_image_set_icon_name()).
 | 
			
		||||
      In GTK+ 2.8, you can also use named icons for drag-and-drop (see 
 | 
			
		||||
      gtk_drag_source_set_icon_name()) and in treeview cells (see the
 | 
			
		||||
      <link linkend="GtkCellRendererPixbuf--icon-name">icon_name</link>
 | 
			
		||||
      property of #GtkCellRendererPixbuf).
 | 
			
		||||
      #GtkCellRendererPixbuf:icon_name property).
 | 
			
		||||
    </para>
 | 
			
		||||
  </section>
 | 
			
		||||
</chapter>
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user