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