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