]> Pileus Git - ~andy/gtk/blob - docs/reference/gtk/migrating-GtkAboutDialog.sgml
Bug 319607 – Add a throbber (activity widget) to GTK+
[~andy/gtk] / docs / reference / gtk / migrating-GtkAboutDialog.sgml
1 <?xml version="1.0"?>
2 <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3                "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
4 ]>
5 <chapter id="gtk-migrating-GtkAboutDialog">
6
7   <title>Migrating from GnomeAbout to GtkAboutDialog</title>
8
9   <para>
10     Since version 2.6, GTK+ provides the #GtkAboutDialog widget as a 
11     replacement for the <structname>GnomeAbout</structname> dialog in 
12     the libgnomeui library.
13   </para>
14
15   <para>
16     #GtkAboutDialog supports all features found in <structname>GnomeAbout</structname>.
17     The <structname>GtkAboutDialog</structname> API is bigger, since it follows 
18     the GTK+ policy to have getters and setters for all widget properties, 
19     but it isn't much more complex than <structname>GnomeAbout</structname>.
20   </para>
21
22   <para>
23     To convert an application that uses <structname>GnomeAbout</structname> to 
24     <structname>GtkAboutDialog</structname>, as a first step, replace calls 
25     like
26     <informalexample><programlisting>
27     const gchar *documentors[] = { 
28       "Documenter 1", 
29       "Documenter 2", 
30       NULL 
31     };
32
33     const gchar *documentors[] = { 
34       "Author 1", 
35       "Author 2", 
36       NULL 
37     };
38
39     GtkWidget *about = gnome_about_new ("GNOME Test Program", VERSION,
40                                         "(C) 1998-2001 The Free Software Foundation",
41                                         "Program to display GNOME functions.",
42                                         authors,
43                                         documenters,
44                                         _("translator-credits"),
45                                         "logo.png");
46     </programlisting></informalexample>
47     by something like 
48     <informalexample><programlisting>
49     GdkPixbuf *logo = gdk_pixbuf_new_from_file ("logo.png", NULL);
50     GtkWidget *about = g_object_new (GTK_TYPE_ABOUT_DIALOG,
51                                      "name", "GNOME Test Program", 
52                                      "version", VERSION,
53                                      "copyright", "(C) 1998-2001 The Free Software Foundation",
54                                      "comments", "Program to display GNOME functions.",
55                                      "authors", authors,
56                                      "documenters", documenters,
57                                      "translator-credits", _("translator-credits"),
58                                      "logo", logo,
59                                      NULL);
60     g_object_unref (pixbuf);
61     </programlisting></informalexample>
62     If the g_object_new() construction scares you, you can also use 
63     gtk_about_dialog_new() to construct the dialog and then use the 
64     setters for the individual properties.
65   </para>
66
67   <para>
68     Once you are done with the initial conversion, you may want to look into 
69     using some of the features of <structname>GtkAboutDialog</structname> 
70     which are not present in <structname>GnomeAbout</structname>.
71     <itemizedlist>
72       <listitem><para>
73         You can specify license information with the 
74         #GtkAboutDialog:license property
75       </para></listitem>
76       <listitem><para>
77         You can add separate credits for artists with the 
78         #GtkAboutDialog:artists property
79       </para></listitem>
80       <listitem><para>
81         You can add a pointer to the website of your application, using the 
82         #GtkAboutDialog:website and #GtkAboutDialog:website-label properties.
83       </para></listitem>
84       <listitem><para>
85         If your credits contain email addresses or URLs, you can turn them 
86         into clickable links using gtk_about_dialog_set_email_hook() and 
87         gtk_about_dialog_set_url_hook(). 
88       </para></listitem>   
89     </itemizedlist>
90   </para>
91 </chapter>
92
93 <!--
94 Local variables:
95 mode: sgml
96 sgml-parent-document: ("gtk-docs.sgml" "book" "part" "chapter")
97 End:
98 -->