GtkAboutDialog

GtkAboutDialog — Display information about an application

Functions

GtkWidget * gtk_about_dialog_new ()
const gchar * gtk_about_dialog_get_program_name ()
void gtk_about_dialog_set_program_name ()
const gchar * gtk_about_dialog_get_version ()
void gtk_about_dialog_set_version ()
const gchar * gtk_about_dialog_get_copyright ()
void gtk_about_dialog_set_copyright ()
const gchar * gtk_about_dialog_get_comments ()
void gtk_about_dialog_set_comments ()
const gchar * gtk_about_dialog_get_license ()
void gtk_about_dialog_set_license ()
gboolean gtk_about_dialog_get_wrap_license ()
void gtk_about_dialog_set_wrap_license ()
GtkLicense gtk_about_dialog_get_license_type ()
void gtk_about_dialog_set_license_type ()
const gchar * gtk_about_dialog_get_website ()
void gtk_about_dialog_set_website ()
const gchar * gtk_about_dialog_get_website_label ()
void gtk_about_dialog_set_website_label ()
const gchar * const * gtk_about_dialog_get_authors ()
void gtk_about_dialog_set_authors ()
const gchar * const * gtk_about_dialog_get_artists ()
void gtk_about_dialog_set_artists ()
const gchar * const * gtk_about_dialog_get_documenters ()
void gtk_about_dialog_set_documenters ()
const gchar * gtk_about_dialog_get_translator_credits ()
void gtk_about_dialog_set_translator_credits ()
GdkPixbuf * gtk_about_dialog_get_logo ()
void gtk_about_dialog_set_logo ()
const gchar * gtk_about_dialog_get_logo_icon_name ()
void gtk_about_dialog_set_logo_icon_name ()
const gchar * gtk_about_dialog_get_system_information ()
void gtk_about_dialog_set_system_information ()
void gtk_about_dialog_add_credit_section ()
void gtk_show_about_dialog ()

Types and Values

Includes

#include <gtk/gtk.h>

Description

The GtkAboutDialog 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 dialogs often contain links and email addresses. GtkAboutDialog displays these as clickable links. By default, it calls gtk_show_uri_on_window() when a user clicks one. The behaviour can be overridden with the “activate-link” signal.

To specify a person with an email address, use a string like "Edgar Allan Poe <edgar@poe.com>". To specify a website with a title, use a string like "GTK+ team http://www.gtk.org".

To make constructing a GtkAboutDialog as convenient as possible, you can use the function gtk_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 GtkAboutDialog, as shown in the following example:

1
2
3
4
5
gtk_show_about_dialog (NULL,
                       "program-name", "ExampleCode",
                       "logo", example_logo,
                       "title" _("About ExampleCode"),
                       NULL);

It is also possible to show a GtkAboutDialog like any other GtkDialog, e.g. using gtk_dialog_run(). In this case, you might need to know that the “Close” button returns the GTK_RESPONSE_CANCEL response id.

Functions

gtk_about_dialog_new ()

GtkWidget *
gtk_about_dialog_new (void);

Creates a new GtkAboutDialog.

Returns

a newly created GtkAboutDialog

Since: 2.6


gtk_about_dialog_get_program_name ()

const gchar *
gtk_about_dialog_get_program_name (GtkAboutDialog *about);

Returns the program name displayed in the about dialog.

Parameters

about

a GtkAboutDialog

 

Returns

The program name. The string is owned by the about dialog and must not be modified.

Since: 2.12


gtk_about_dialog_set_program_name ()

void
gtk_about_dialog_set_program_name (GtkAboutDialog *about,
                                   const gchar *name);

Sets the name to display in the about dialog. If this is not set, it defaults to g_get_application_name().

Parameters

about

a GtkAboutDialog

 

name

the program name

 

Since: 2.12


gtk_about_dialog_get_version ()

const gchar *
gtk_about_dialog_get_version (GtkAboutDialog *about);

Returns the version string.

Parameters

about

a GtkAboutDialog

 

Returns

The version string. The string is owned by the about dialog and must not be modified.

Since: 2.6


gtk_about_dialog_set_version ()

void
gtk_about_dialog_set_version (GtkAboutDialog *about,
                              const gchar *version);

Sets the version string to display in the about dialog.

Parameters

about

a GtkAboutDialog

 

version

the version string.

[allow-none]

Since: 2.6


gtk_about_dialog_get_copyright ()

const gchar *
gtk_about_dialog_get_copyright (GtkAboutDialog *about);

Returns the copyright string.

Parameters

about

a GtkAboutDialog

 

Returns

The copyright string. The string is owned by the about dialog and must not be modified.

Since: 2.6


gtk_about_dialog_set_copyright ()

void
gtk_about_dialog_set_copyright (GtkAboutDialog *about,
                                const gchar *copyright);

Sets the copyright string to display in the about dialog. This should be a short string of one or two lines.

Parameters

about

a GtkAboutDialog

 

copyright

the copyright string.

[allow-none]

Since: 2.6


gtk_about_dialog_get_comments ()

const gchar *
gtk_about_dialog_get_comments (GtkAboutDialog *about);

Returns the comments string.

Parameters

about

a GtkAboutDialog

 

Returns

The comments. The string is owned by the about dialog and must not be modified.

Since: 2.6


gtk_about_dialog_set_comments ()

void
gtk_about_dialog_set_comments (GtkAboutDialog *about,
                               const gchar *comments);

Sets the comments string to display in the about dialog. This should be a short string of one or two lines.

Parameters

about

a GtkAboutDialog

 

comments

a comments string.

[allow-none]

Since: 2.6


gtk_about_dialog_get_license ()

const gchar *
gtk_about_dialog_get_license (GtkAboutDialog *about);

Returns the license information.

Parameters

about

a GtkAboutDialog

 

Returns

The license information. The string is owned by the about dialog and must not be modified.

Since: 2.6


gtk_about_dialog_set_license ()

void
gtk_about_dialog_set_license (GtkAboutDialog *about,
                              const gchar *license);

Sets the license information to be displayed in the secondary license dialog. If license is NULL, the license button is hidden.

Parameters

about

a GtkAboutDialog

 

license

the license information or NULL.

[allow-none]

Since: 2.6


gtk_about_dialog_get_wrap_license ()

gboolean
gtk_about_dialog_get_wrap_license (GtkAboutDialog *about);

Returns whether the license text in about is automatically wrapped.

Parameters

about

a GtkAboutDialog

 

Returns

TRUE if the license text is wrapped

Since: 2.8


gtk_about_dialog_set_wrap_license ()

void
gtk_about_dialog_set_wrap_license (GtkAboutDialog *about,
                                   gboolean wrap_license);

Sets whether the license text in about is automatically wrapped.

Parameters

about

a GtkAboutDialog

 

wrap_license

whether to wrap the license

 

Since: 2.8


gtk_about_dialog_get_license_type ()

GtkLicense
gtk_about_dialog_get_license_type (GtkAboutDialog *about);

Retrieves the license set using gtk_about_dialog_set_license_type()

Parameters

about

a GtkAboutDialog

 

Returns

a GtkLicense value

Since: 3.0


gtk_about_dialog_set_license_type ()

void
gtk_about_dialog_set_license_type (GtkAboutDialog *about,
                                   GtkLicense license_type);

Sets the license of the application showing the about dialog from a list of known licenses.

This function overrides the license set using gtk_about_dialog_set_license().

Parameters

about

a GtkAboutDialog

 

license_type

the type of license

 

Since: 3.0


gtk_about_dialog_get_website ()

const gchar *
gtk_about_dialog_get_website (GtkAboutDialog *about);

Returns the website URL.

Parameters

about

a GtkAboutDialog

 

Returns

The website URL. The string is owned by the about dialog and must not be modified.

Since: 2.6


gtk_about_dialog_set_website ()

void
gtk_about_dialog_set_website (GtkAboutDialog *about,
                              const gchar *website);

Sets the URL to use for the website link.

Parameters

about

a GtkAboutDialog

 

website

a URL string starting with "http://".

[allow-none]

Since: 2.6


gtk_about_dialog_get_website_label ()

const gchar *
gtk_about_dialog_get_website_label (GtkAboutDialog *about);

Returns the label used for the website link.

Parameters

about

a GtkAboutDialog

 

Returns

The label used for the website link. The string is owned by the about dialog and must not be modified.

Since: 2.6


gtk_about_dialog_set_website_label ()

void
gtk_about_dialog_set_website_label (GtkAboutDialog *about,
                                    const gchar *website_label);

Sets the label to be used for the website link.

Parameters

about

a GtkAboutDialog

 

website_label

the label used for the website link

 

Since: 2.6


gtk_about_dialog_get_authors ()

const gchar * const *
gtk_about_dialog_get_authors (GtkAboutDialog *about);

Returns the string which are displayed in the authors tab of the secondary credits dialog.

Parameters

about

a GtkAboutDialog

 

Returns

A NULL-terminated string array containing the authors. The array is owned by the about dialog and must not be modified.

[array zero-terminated=1][transfer none]

Since: 2.6


gtk_about_dialog_set_authors ()

void
gtk_about_dialog_set_authors (GtkAboutDialog *about,
                              const gchar **authors);

Sets the strings which are displayed in the authors tab of the secondary credits dialog.

Parameters

about

a GtkAboutDialog

 

authors

a NULL-terminated array of strings.

[array zero-terminated=1]

Since: 2.6


gtk_about_dialog_get_artists ()

const gchar * const *
gtk_about_dialog_get_artists (GtkAboutDialog *about);

Returns the string which are displayed in the artists tab of the secondary credits dialog.

Parameters

about

a GtkAboutDialog

 

Returns

A NULL-terminated string array containing the artists. The array is owned by the about dialog and must not be modified.

[array zero-terminated=1][transfer none]

Since: 2.6


gtk_about_dialog_set_artists ()

void
gtk_about_dialog_set_artists (GtkAboutDialog *about,
                              const gchar **artists);

Sets the strings which are displayed in the artists tab of the secondary credits dialog.

Parameters

about

a GtkAboutDialog

 

artists

a NULL-terminated array of strings.

[array zero-terminated=1]

Since: 2.6


gtk_about_dialog_get_documenters ()

const gchar * const *
gtk_about_dialog_get_documenters (GtkAboutDialog *about);

Returns the string which are displayed in the documenters tab of the secondary credits dialog.

Parameters

about

a GtkAboutDialog

 

Returns

A NULL-terminated string array containing the documenters. The array is owned by the about dialog and must not be modified.

[array zero-terminated=1][transfer none]

Since: 2.6


gtk_about_dialog_set_documenters ()

void
gtk_about_dialog_set_documenters (GtkAboutDialog *about,
                                  const gchar **documenters);

Sets the strings which are displayed in the documenters tab of the secondary credits dialog.

Parameters

about

a GtkAboutDialog

 

documenters

a NULL-terminated array of strings.

[array zero-terminated=1]

Since: 2.6


gtk_about_dialog_get_translator_credits ()

const gchar *
gtk_about_dialog_get_translator_credits
                               (GtkAboutDialog *about);

Returns the translator credits string which is displayed in the translators tab of the secondary credits dialog.

Parameters

about

a GtkAboutDialog

 

Returns

The translator credits string. The string is owned by the about dialog and must not be modified.

Since: 2.6


gtk_about_dialog_set_translator_credits ()

void
gtk_about_dialog_set_translator_credits
                               (GtkAboutDialog *about,
                                const gchar *translator_credits);

Sets the translator credits string which is displayed in the translators tab of the secondary credits dialog.

The intended use for this string is to display the translator of the language which is currently used in the user interface. Using gettext(), a simple way to achieve that is to mark the string for translation:

1
2
gtk_about_dialog_set_translator_credits (about,
                                         _("translator-credits"));

It is a good idea to use the customary msgid “translator-credits” for this purpose, since translators will already know the purpose of that msgid, and since GtkAboutDialog will detect if “translator-credits” is untranslated and hide the tab.

Parameters

about

a GtkAboutDialog

 

translator_credits

the translator credits.

[allow-none]

Since: 2.6


gtk_about_dialog_get_logo ()

GdkPixbuf *
gtk_about_dialog_get_logo (GtkAboutDialog *about);

Returns the pixbuf displayed as logo in the about dialog.

Parameters

about

a GtkAboutDialog

 

Returns

the pixbuf displayed as logo. The pixbuf is owned by the about dialog. If you want to keep a reference to it, you have to call g_object_ref() on it.

[transfer none]

Since: 2.6


gtk_about_dialog_set_logo ()

void
gtk_about_dialog_set_logo (GtkAboutDialog *about,
                           GdkPixbuf *logo);

Sets the pixbuf to be displayed as logo in the about dialog. If it is NULL, the default window icon set with gtk_window_set_default_icon() will be used.

Parameters

about

a GtkAboutDialog

 

logo

a GdkPixbuf, or NULL.

[allow-none]

Since: 2.6


gtk_about_dialog_get_logo_icon_name ()

const gchar *
gtk_about_dialog_get_logo_icon_name (GtkAboutDialog *about);

Returns the icon name displayed as logo in the about dialog.

Parameters

about

a GtkAboutDialog

 

Returns

the icon name displayed as logo. The string is owned by the dialog. If you want to keep a reference to it, you have to call g_strdup() on it.

Since: 2.6


gtk_about_dialog_set_logo_icon_name ()

void
gtk_about_dialog_set_logo_icon_name (GtkAboutDialog *about,
                                     const gchar *icon_name);

Sets the pixbuf to be displayed as logo in the about dialog. If it is NULL, the default window icon set with gtk_window_set_default_icon() will be used.

Parameters

about

a GtkAboutDialog

 

icon_name

an icon name, or NULL.

[allow-none]

Since: 2.6


gtk_about_dialog_get_system_information ()

const gchar *
gtk_about_dialog_get_system_information
                               (GtkAboutDialog *about);

gtk_about_dialog_set_system_information ()

void
gtk_about_dialog_set_system_information
                               (GtkAboutDialog *about,
                                const gchar *system_information);

gtk_about_dialog_add_credit_section ()

void
gtk_about_dialog_add_credit_section (GtkAboutDialog *about,
                                     const gchar *section_name,
                                     const gchar **people);

Creates a new section in the Credits page.

Parameters

about

A GtkAboutDialog

 

section_name

The name of the section

 

people

The people who belong to that section.

[array zero-terminated=1]

Since: 3.4


gtk_show_about_dialog ()

void
gtk_show_about_dialog (GtkWindow *parent,
                       const gchar *first_property_name,
                       ...);

This is a convenience function for showing an application’s about box. The constructed dialog is associated with the parent window and reused for future invocations of this function.

Parameters

parent

transient parent, or NULL for none.

[allow-none]

first_property_name

the name of the first property

 

...

value of first property, followed by more properties, NULL-terminated

 

Since: 2.6

Types and Values

struct GtkAboutDialog

struct GtkAboutDialog {
  GtkDialog parent_instance;
};

The GtkAboutDialog contains only private fields and should not be directly accessed.


enum GtkLicense

The type of license for an application.

This enumeration can be expanded at later date.

Members

GTK_LICENSE_UNKNOWN

No license specified

 

GTK_LICENSE_CUSTOM

A license text is going to be specified by the developer

 

GTK_LICENSE_GPL_2_0

The GNU General Public License, version 2.0 or later

 

GTK_LICENSE_GPL_3_0

The GNU General Public License, version 3.0 or later

 

GTK_LICENSE_LGPL_2_1

The GNU Lesser General Public License, version 2.1 or later

 

GTK_LICENSE_LGPL_3_0

The GNU Lesser General Public License, version 3.0 or later

 

GTK_LICENSE_BSD

The BSD standard license

 

GTK_LICENSE_MIT_X11

The MIT/X11 standard license

 

GTK_LICENSE_ARTISTIC

The Artistic License, version 2.0

 

GTK_LICENSE_GPL_2_0_ONLY

The GNU General Public License, version 2.0 only. Since 3.12.

 

GTK_LICENSE_GPL_3_0_ONLY

The GNU General Public License, version 3.0 only. Since 3.12.

 

GTK_LICENSE_LGPL_2_1_ONLY

The GNU Lesser General Public License, version 2.1 only. Since 3.12.

 

GTK_LICENSE_LGPL_3_0_ONLY

The GNU Lesser General Public License, version 3.0 only. Since 3.12.

 

GTK_LICENSE_AGPL_3_0

The GNU Affero General Public License, version 3.0 or later. Since: 3.22.

 

Since: 3.0