Valadoc | Vala | Tutorial | API-References | Markup

AboutDialog


Object Hierarchy:

Object hierarchy for AboutDialog

Description:

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.


Namespace: Gtk
Package: gtk+-2.0

Content:

Properties:

Static methods:

Creation methods:

Methods: