The AboutDialog offers a simple way to display information about a program like its
logo, name, copyright, website and license. It is also possible to give credits to the authors, documenters, translators and artists who
have worked on the program. An about dialog is typically opened when the user selects the About option from the Help menu.
All parts of the dialog are optional.
About dialog often contain links and email addresses. AboutDialog supports this by
offering global hooks, which are called when the user clicks on a link or email address, see
set_email_hook and
set_url_hook. Email addresses in the authors, documenters and
artists properties are recognized by looking for <user@host>, URLs are recognized by looking for http://url,
with url extending to the next space, tab or line break.
Since 2.18 AboutDialog provides default website and email hooks that use
show_uri.
If you want provide your own hooks overriding the default ones, it is important to do so before setting the website and email URL
properties, like this:
gtk_about_dialog_set_url_hook (GTK_ABOUT_DIALOG (dialog), launch_url, NULL, NULL);
gtk_about_dialog_set_website (GTK_ABOUT_DIALOG (dialog), app_url);
To disable the default hooks, you can pass null as the hook func. Then, the
AboutDialog widget will not display the website or the email addresses as clickable.
To make constructing a AboutDialog as convenient as possible, you can use the function
show_about_dialog which constructs and shows a dialog and keeps it around so that
it can be shown again.
Note that GTK+ sets a default title of _("About %s") on the dialog window (where %s is replaced by the name
of the application, but in order to ensure proper translation of the title, applications should set the title property explicitly when
constructing a AboutDialog, as shown in the following example:
gtk_show_about_dialog (NULL,
"program-name", "ExampleCode",
"logo", example_logo,
"title" _("About ExampleCode"),
NULL);
Note that prior to GTK+ 2.12, the program_name property was called
"name". This was changed to avoid the conflict with the name property.
-
public string[] artists { set; get; }
The people who contributed artwork to the program, as a null-terminated array of strings.
Each string may contain email addresses and URLs, which will be displayed as links, see the introduction for more details.
-
public string[] authors { set; get; }
The authors of the program, as a null-terminated array of strings. Each string may contain
email addresses and URLs, which will be displayed as links, see the introduction for more details.
-
public string comments { set; get; }
Comments about the program. This string is displayed in a label in the main dialog, thus it should be a
short explanation of the main purpose of the program, not a detailed list of features.
-
public string copyright { set; get; }
Copyright information for the program.
-
public string[] documenters { set; get; }
The people documenting the program, as a null-terminated array of strings. Each string may
contain email addresses and URLs, which will be displayed as links, see the introduction for more details.
-
public string license { set; get; }
The license of the program. This string is displayed in a text view in a secondary dialog, therefore it
is fine to use a long multi-paragraph text. Note that the text is only wrapped in the text view if the "wrap-license" property is set
to true; otherwise the text itself must contain the intended linebreaks.
-
public Pixbuf logo { set; get; }
-
public string logo_icon_name { set; get; }
A named icon to use as the logo for the about box. This property overrides the
logo property.
-
public string program_name { set; get; }
-
public string translator_credits { set; get; }
Credits to the translators. This string should be marked as translatable. The string may contain email
addresses and URLs, which will be displayed as links, see the introduction for more details.
-
public string version { set; get; }
The version of the program.
-
public string website { set; get; }
The URL for the link to the website of the program. This should be a string starting with "http://.
-
public string website_label { set; get; }
The label for the link to the website of the program. If this is not set, it defaults to the URL
specified in the website property.
-
public bool wrap_license { set; get; }
Whether to wrap the text in the license dialog.
-
public unowned string get_artists ()
Returns the string which are displayed in the artists tab of the secondary credits dialog.
-
public unowned string get_authors ()
Returns the string which are displayed in the authors tab of the secondary credits dialog.
-
public unowned string get_comments ()
Returns the comments string.
-
public unowned string get_copyright ()
Returns the copyright string.
-
public unowned string get_documenters ()
Returns the string which are displayed in the documenters tab of the secondary credits dialog.
-
public unowned string get_license ()
Returns the license information.
-
public weak Pixbuf get_logo ()
Returns the pixbuf displayed as logo in the about dialog.
-
public unowned string get_logo_icon_name ()
Returns the icon name displayed as logo in the about dialog.
-
public unowned string get_program_name ()
Returns the program name displayed in the about dialog.
-
public unowned string get_translator_credits ()
Returns the translator credits string which is displayed in the translators tab of the secondary credits
dialog.
-
public unowned string get_version ()
Returns the version string.
-
public unowned string get_website ()
Returns the website URL.
-
public unowned string get_website_label ()
Returns the label used for the website link.
-
public bool get_wrap_license ()
Returns whether the license text in about is automatically wrapped.
-
public void set_artists (string[] artists)
Sets the strings which are displayed in the artists tab of the secondary credits dialog.
-
public void set_authors (string[] authors)
Sets the strings which are displayed in the authors tab of the secondary credits dialog.
-
public void set_comments (string comments)
Sets the comments string to display in the about dialog. This should be a short string of one or two
lines.
-
public void set_copyright (string copyright)
Sets the copyright string to display in the about dialog. This should be a short string of one or two
lines.
-
public void set_documenters (string[] documenters)
Sets the strings which are displayed in the documenters tab of the secondary credits dialog.
-
public void set_license (string license)
Sets the license information to be displayed in the secondary license dialog. If license is
null, the license button is hidden.
-
public void set_logo (Pixbuf logo)
Sets the pixbuf to be displayed as logo in the about dialog. If it is null, the default
window icon set with set_default_icon will be used.
-
public void set_logo_icon_name (string icon_name)
Sets the pixbuf to be displayed as logo in the about dialog. If it is null, the default
window icon set with set_default_icon will be used.
-
public void set_program_name (string name)
Sets the name to display in the about dialog. If this is not set, it defaults to
get_application_name.
-
public void set_translator_credits (string translator_credits)
Sets the translator credits string which is displayed in the translators tab of the secondary credits
dialog.
-
public void set_version (string version)
Sets the version string to display in the about dialog.
-
public void set_website (string website)
Sets the URL to use for the website link.
-
public void set_website_label (string website_label)
Sets the label to be used for the website link. It defaults to the website URL.
-
public void set_wrap_license (bool wrap_license)
Sets whether the license text in about is automatically wrapped.