1.2 <GtkAboutDialog>

Class: <GtkAboutDialog>

It derives from <GtkWindow>.

Displays information about a program.

The shown information includes the programs’ 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 file-launcher:launch when a user clicks one. The behaviour can be overridden with the about-dialog: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 https://www.gtk.org.

To make constructing an about dialog 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 an about dialog, as shown in the following example:

GFile *logo_file = g_file_new_for_path ("./logo.png");
GdkTexture *example_logo = gdk_texture_new_from_file (logo_file, NULL);
g_object_unref (logo_file);

gtk_show_about_dialog (NULL,
                       "program-name", "ExampleCode",
                       "logo", example_logo,
                       "title", _("About ExampleCode"),
                       NULL);

Shortcuts and Gestures

<GtkAboutDialog> supports the following keyboard shortcuts:

  • Escape closes the window.

CSS nodes

<GtkAboutDialog> has a single CSS node with the name window and style class .aboutdialog.

Properties

Property: about-dialog:artists self

The people who contributed artwork to the program.

Each string may contain email addresses and URLs, which will be displayed as links.

Its value is a vector, each a string (or, to set it, a list), or #f.

Set it with (set! (about-dialog:artists self) value).

Property: about-dialog:authors self

The authors of the program.

Each string may contain email addresses and URLs, which will be displayed as links, see the introduction for more details.

Its value is a vector, each a string (or, to set it, a list), or #f.

Set it with (set! (about-dialog:authors self) value).

Property: about-dialog:comments self

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.

Its value is a string, or #f.

Set it with (set! (about-dialog:comments self) value).

Property: about-dialog:copyright self

Copyright information for the program.

Its value is a string, or #f.

Set it with (set! (about-dialog:copyright self) value).

Property: about-dialog:documenters self

The people documenting the program.

Each string may contain email addresses and URLs, which will be displayed as links, see the introduction for more details.

Its value is a vector, each a string (or, to set it, a list), or #f.

Set it with (set! (about-dialog:documenters self) value).

Property: about-dialog:license self

The license of the program, as free-form text.

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.

When setting this property to a non-NULL value, the about-dialog:license-type property is set to Gtk.License.custom as a side effect.

The text may contain links in this format <http://www.some.place/> and email references in the form <mail-to@some.body>, and these will be converted into clickable links.

Its value is a string, or #f.

Set it with (set! (about-dialog:license self) value).

Property: about-dialog:license-type self

The license of the program.

The <GtkAboutDialog> will automatically fill out a standard disclaimer and link the user to the appropriate online resource for the license text.

If Gtk.License.unknown is used, the link used will be the same specified in the about-dialog:website property.

If Gtk.License.custom is used, the current contents of the about-dialog:license property are used.

For any other <GtkLicense> value, the contents of the about-dialog:license property are also set by this property as a side effect.

Its value is a <GtkLicense> (or, to set it, one of its symbols).

Set it with (set! (about-dialog:license-type self) value).

A logo for the about box.

If it is NULL, the default window icon set with window:set-default-icon-name will be used.

Its value is a <GdkPaintable>, or #f.

Set it with (set! (about-dialog:logo self) value).

Property: about-dialog:logo-icon-name self

A named icon to use as the logo for the about box.

This property overrides the about-dialog:logo property.

Its value is a string, or #f.

Set it with (set! (about-dialog:logo-icon-name self) value).

Property: about-dialog:program-name self

The name of the program.

If this is not set, it defaults to the value returned by get-application-name.

Its value is a string, or #f.

Set it with (set! (about-dialog:program-name self) value).

Property: about-dialog:system-information self

Information about the system on which the program is running.

This information is displayed in a separate page, therefore it is fine to use a long multi-paragraph text. Note that the text should contain the intended linebreaks.

The text may contain links in this format <http://www.some.place/> and email references in the form <mail-to@some.body>, and these will be converted into clickable links.

Its value is a string, or #f.

Set it with (set! (about-dialog:system-information self) value).

Property: about-dialog:translator-credits self

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.

Its value is a string, or #f.

Set it with (set! (about-dialog:translator-credits self) value).

Property: about-dialog:version self

The version of the program.

Its value is a string, or #f.

Set it with (set! (about-dialog:version self) value).

Property: about-dialog:website self

The URL for the link to the website of the program.

This should be a string starting with http:// or https://.

Its value is a string, or #f.

Set it with (set! (about-dialog:website self) value).

Property: about-dialog:website-label self

The label for the link to the website of the program.

Its value is a string, or #f.

Set it with (set! (about-dialog:website-label self) value).

Property: about-dialog:wrap-license self

Whether to wrap the text in the license dialog.

Its value is a boolean.

Set it with (set! (about-dialog:wrap-license self) value).

Procedures

Method: about-dialog:add-credit-section self section-name people
Method: add-credit-section self section-name people

Creates a new section in the "Credits" page.

self

Passed: a <GtkAboutDialog>.

an about dialog

section-name

Passed: a string.

The name of the section

people

Passed: a list or vector, each a string.

the people who belong to that section

Method: about-dialog:get-artists self ⇒ %return
Method: get-artists self ⇒ %return

Returns the names of the artists which are displayed in the credits page.

self

Passed: a <GtkAboutDialog>.

an about dialog

%return

Returned: a vector, each a string.

A NULL-terminated string array containing the artists

Method: about-dialog:get-authors self ⇒ %return
Method: get-authors self ⇒ %return

Returns the names of the authors which are displayed in the credits page.

self

Passed: a <GtkAboutDialog>.

an about dialog

%return

Returned: a vector, each a string.

A NULL-terminated string array containing the authors

Method: about-dialog:get-comments self ⇒ %return
Method: get-comments self ⇒ %return

Returns the comments string.

self

Passed: a <GtkAboutDialog>.

an about dialog

%return

Returned: a string, or #f.

The comments

Method: about-dialog:get-copyright self ⇒ %return
Method: get-copyright self ⇒ %return

Returns the copyright string.

self

Passed: a <GtkAboutDialog>.

an about dialog

%return

Returned: a string, or #f.

The copyright string

Method: about-dialog:get-documenters self ⇒ %return
Method: get-documenters self ⇒ %return

Returns the name of the documenters which are displayed in the credits page.

self

Passed: a <GtkAboutDialog>.

an about dialog

%return

Returned: a vector, each a string.

A NULL-terminated string array containing the documenters

Method: about-dialog:get-license self ⇒ %return
Method: get-license self ⇒ %return

Returns the license information.

self

Passed: a <GtkAboutDialog>.

an about dialog

%return

Returned: a string, or #f.

The license information

Method: about-dialog:get-license-type self ⇒ %return
Method: get-license-type self ⇒ %return

Retrieves the license type.

self

Passed: a <GtkAboutDialog>.

an about dialog

%return

Returned: a <GtkLicense>.

a <GtkLicense> value

Returns the paintable displayed as logo in the about dialog.

self

Passed: a <GtkAboutDialog>.

an about dialog

%return

Returned: a <GdkPaintable>, or #f.

the paintable displayed as logo or NULL if the logo is unset or has been set via about-dialog:set-logo-icon-name

Method: about-dialog:get-logo-icon-name self ⇒ %return
Method: get-logo-icon-name self ⇒ %return

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

self

Passed: a <GtkAboutDialog>.

an about dialog

%return

Returned: a string, or #f.

the icon name displayed as logo, or NULL if the logo has been set via about-dialog:set-logo

Method: about-dialog:get-program-name self ⇒ %return
Method: get-program-name self ⇒ %return

Returns the program name displayed in the about dialog.

self

Passed: a <GtkAboutDialog>.

an about dialog

%return

Returned: a string, or #f.

the program name

Method: about-dialog:get-system-information self ⇒ %return
Method: get-system-information self ⇒ %return

Returns the system information that is shown in the about dialog.

self

Passed: a <GtkAboutDialog>.

an about dialog

%return

Returned: a string, or #f.

the system information

Method: about-dialog:get-translator-credits self ⇒ %return
Method: get-translator-credits self ⇒ %return

Returns the translator credits string which is displayed in the credits page.

self

Passed: a <GtkAboutDialog>.

an about dialog

%return

Returned: a string, or #f.

The translator credits string

Method: about-dialog:get-version self ⇒ %return
Method: get-version self ⇒ %return

Returns the version string.

self

Passed: a <GtkAboutDialog>.

an about dialog

%return

Returned: a string, or #f.

The version string

Method: about-dialog:get-website self ⇒ %return
Method: get-website self ⇒ %return

Returns the website URL.

self

Passed: a <GtkAboutDialog>.

an about dialog

%return

Returned: a string, or #f.

The website URL

Method: about-dialog:get-website-label self ⇒ %return
Method: get-website-label self ⇒ %return

Returns the label used for the website link.

self

Passed: a <GtkAboutDialog>.

an about dialog

%return

Returned: a string, or #f.

The label used for the website link

Method: about-dialog:get-wrap-license? self ⇒ %return
Method: get-wrap-license? self ⇒ %return

Returns whether the license text in the about dialog is automatically wrapped.

self

Passed: a <GtkAboutDialog>.

an about dialog

%return

Returned: a boolean.

TRUE if the license text is wrapped

Procedure: about-dialog:new ⇒ %return

Creates a new <GtkAboutDialog>.

%return

Returned: a <GtkWidget>.

a newly created <GtkAboutDialog>

Method: about-dialog:set-artists self artists
Method: set-artists self artists

Sets the names of the artists to be displayed in the "Credits" page.

self

Passed: a <GtkAboutDialog>.

an about dialog

artists

Passed: a list or vector, each a string.

the authors of the artwork of the application

Method: about-dialog:set-authors self authors
Method: set-authors self authors

Sets the names of the authors which are displayed in the "Credits" page of the about dialog.

self

Passed: a <GtkAboutDialog>.

an about dialog

authors

Passed: a list or vector, each a string.

the authors of the application

Method: about-dialog:set-comments self [comments]
Method: set-comments self [comments]

Sets the comments string to display in the about dialog.

This should be a short string of one or two lines.

self

Passed: a <GtkAboutDialog>.

an about dialog

comments

Passed, or left out: a string, or #f.

a comments string

Method: about-dialog:set-copyright self [copyright]
Method: set-copyright self [copyright]

Sets the copyright string to display in the about dialog.

This should be a short string of one or two lines.

self

Passed: a <GtkAboutDialog>.

an about dialog

copyright

Passed, or left out: a string, or #f.

the copyright string

Method: about-dialog:set-documenters self documenters
Method: set-documenters self documenters

Sets the names of the documenters which are displayed in the "Credits" page.

self

Passed: a <GtkAboutDialog>.

an about dialog

documenters

Passed: a list or vector, each a string.

the authors of the documentation of the application

Method: about-dialog:set-license self [license]
Method: set-license self [license]

Sets the license information to be displayed in the about dialog.

If license is NULL, the license page is hidden.

self

Passed: a <GtkAboutDialog>.

an about dialog

license

Passed, or left out: a string, or #f.

the license information

Method: about-dialog:set-license-type self license-type
Method: set-license-type self 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 about-dialog:set-license.

self

Passed: a <GtkAboutDialog>.

an about dialog

license-type

Passed: a <GtkLicense>, or one of its symbols.

the type of license

Sets the logo in the about dialog.

self

Passed: a <GtkAboutDialog>.

an about dialog

logo

Passed, or left out: a <GdkPaintable>, or #f.

a <GdkPaintable>

Method: about-dialog:set-logo-icon-name self [icon-name]
Method: set-logo-icon-name self [icon-name]

Sets the icon name to be displayed as logo in the about dialog.

self

Passed: a <GtkAboutDialog>.

an about dialog

icon-name

Passed, or left out: a string, or #f.

an icon name

Method: about-dialog:set-program-name self [name]
Method: set-program-name self [name]

Sets the name to display in the about dialog.

If name is not set, the string returned by get-application-name is used.

self

Passed: a <GtkAboutDialog>.

an about dialog

name

Passed, or left out: a string, or #f.

the program name

Method: about-dialog:set-system-information self [system-information]
Method: set-system-information self [system-information]

Sets the system information to be displayed in the about dialog.

If system_information is NULL, the system information page is hidden.

See about-dialog:system-information.

self

Passed: a <GtkAboutDialog>.

an about dialog

system-information

Passed, or left out: a string, or #f.

system information

Method: about-dialog:set-translator-credits self [translator-credits]
Method: set-translator-credits self [translator-credits]

Sets the translator credits string which is displayed in the credits page.

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:

GtkWidget *about = gtk_about_dialog_new ();
 gtk_about_dialog_set_translator_credits (GTK_ABOUT_DIALOG (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 omit translator credits.

self

Passed: a <GtkAboutDialog>.

an about dialog

translator-credits

Passed, or left out: a string, or #f.

the translator credits

Method: about-dialog:set-version self [version]
Method: set-version self [version]

Sets the version string to display in the about dialog.

self

Passed: a <GtkAboutDialog>.

an about dialog

version

Passed, or left out: a string, or #f.

the version string

Method: about-dialog:set-website self [website]
Method: set-website self [website]

Sets the URL to use for the website link.

self

Passed: a <GtkAboutDialog>.

an about dialog

website

Passed, or left out: a string, or #f.

a URL string starting with http://

Method: about-dialog:set-website-label self website-label
Method: set-website-label self website-label

Sets the label to be used for the website link.

self

Passed: a <GtkAboutDialog>.

an about dialog

website-label

Passed: a string.

the label used for the website link

Method: about-dialog:set-wrap-license self wrap-license
Method: set-wrap-license self wrap-license

Sets whether the license text in the about dialog should be automatically wrapped.

self

Passed: a <GtkAboutDialog>.

an about dialog

wrap-license

Passed: a boolean.

whether to wrap the license

Signals

Connect a handler with (connect object about-dialog:activate-link handler). It is called as (handler self uri) ⇒ %return.

Emitted every time a URL is activated.

Applications may connect to it to override the default behaviour, which is to call file-launcher:launch.

self

Passed: a <GtkAboutDialog>.

uri

Passed: a string.

the URI that is activated

%return

Returned: a boolean.

TRUE if the link has been activated