Gtk.AboutDialog

g GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget Gtk.Native Gtk.Native GObject.GInterface->Gtk.Native Gtk.Root Gtk.Root GObject.GInterface->Gtk.Root Gtk.ShortcutManager Gtk.ShortcutManager GObject.GInterface->Gtk.ShortcutManager GObject.InitiallyUnowned GObject.InitiallyUnowned Gtk.Widget Gtk.Widget GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.AboutDialog Gtk.AboutDialog Gtk.Accessible->Gtk.Widget Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Gtk.Window Gtk.Window Gtk.Native->Gtk.Window Gtk.Root->Gtk.Window Gtk.ShortcutManager->Gtk.Window Gtk.Widget->Gtk.Window Gtk.Window->Gtk.AboutDialog

Example

../_images/AboutDialog.png
Subclasses:

None

Methods

Inherited:

Gtk.Window (62), Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1), Gtk.Native (6), Gtk.Root (3)

Structs:

Gtk.WidgetClass (18), GObject.ObjectClass (5)

class

new ()

add_credit_section (section_name, people)

get_artists ()

get_authors ()

get_comments ()

get_copyright ()

get_documenters ()

get_license ()

get_license_type ()

get_logo ()

get_logo_icon_name ()

get_program_name ()

get_system_information ()

get_translator_credits ()

get_version ()

get_website ()

get_website_label ()

get_wrap_license ()

set_artists (artists)

set_authors (authors)

set_comments (comments)

set_copyright (copyright)

set_documenters (documenters)

set_license (license)

set_license_type (license_type)

set_logo (logo)

set_logo_icon_name (icon_name)

set_program_name (name)

set_system_information (system_information)

set_translator_credits (translator_credits)

set_version (version)

set_website (website)

set_website_label (website_label)

set_wrap_license (wrap_license)

Virtual Methods

Inherited:

Gtk.Window (5), Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9), Gtk.ShortcutManager (2)

Properties

Inherited:

Gtk.Window (25), Gtk.Widget (34), Gtk.Accessible (1)

Name

Type

Flags

Short Description

artists

[str]

r/w/en

authors

[str]

r/w/en

comments

str

r/w/en

copyright

str

r/w/en

documenters

[str]

r/w/en

license

str

r/w/en

license-type

Gtk.License

r/w/en

logo

Gdk.Paintable

r/w/en

logo-icon-name

str

r/w/en

program-name

str

r/w/en

system-information

str

r/w/en

translator-credits

str

r/w/en

version

str

r/w/en

website

str

r/w/en

website-label

str

r/w/en

wrap-license

bool

r/w/en

Signals

Inherited:

Gtk.Window (5), Gtk.Widget (13), GObject.Object (1)

Name

Short Description

activate-link

Emitted every time a URL is activated.

Fields

Inherited:

Gtk.Window (5), Gtk.Widget (13), GObject.Object (1)

Class Details

class Gtk.AboutDialog(*args, **kwargs)
Bases:

Gtk.Window

Abstract:

No

The GtkAboutDialog offers a simple way to display 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.

An example Gtk.AboutDialog

About dialogs often contain links and email addresses. GtkAboutDialog displays these as clickable links. By default, it calls [method`Gtk`.FileLauncher.launch] when a user clicks one. The behaviour can be overridden with the [signal`Gtk`.AboutDialog::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 a GtkAboutDialog as convenient as possible, you can use the function [func`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:

```c Gio.File *logo_file = Gio.File.new_for_path (“./logo.png”); Gdk.Texture *example_logo = Gdk.Texture.new_from_file (logo_file, None); GObject.Object.unref (logo_file);

gtk_show_about_dialog (None, “program-name”, “ExampleCode”, “logo”, example_logo, “title”, _(“About ExampleCode”), None); ```

CSS nodes

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

classmethod new()[source]
Returns:

a newly created GtkAboutDialog

Return type:

Gtk.Widget

Creates a new GtkAboutDialog.

add_credit_section(section_name, people)[source]
Parameters:
  • section_name (str) – The name of the section

  • people ([str]) – The people who belong to that section

Creates a new section in the “Credits” page.

get_artists()[source]
Returns:

A NULL-terminated string array containing the artists

Return type:

[str]

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

get_authors()[source]
Returns:

A NULL-terminated string array containing the authors

Return type:

[str]

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

get_comments()[source]
Returns:

The comments

Return type:

str or None

Returns the comments string.

Returns:

The copyright string

Return type:

str or None

Returns the copyright string.

get_documenters()[source]
Returns:

A NULL-terminated string array containing the documenters

Return type:

[str]

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

get_license()[source]
Returns:

The license information

Return type:

str or None

Returns the license information.

get_license_type()[source]
Returns:

a [enum`Gtk`.License] value

Return type:

Gtk.License

Retrieves the license type.

Returns:

the paintable displayed as logo or NULL if the logo is unset or has been set via [method`Gtk`.AboutDialog.set_logo_icon_name]

Return type:

Gdk.Paintable or None

Returns the paintable displayed as logo in the about dialog.

get_logo_icon_name()[source]
Returns:

the icon name displayed as logo, or NULL if the logo has been set via [method`Gtk`.AboutDialog.set_logo]

Return type:

str or None

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

get_program_name()[source]
Returns:

The program name

Return type:

str or None

Returns the program name displayed in the about dialog.

get_system_information()[source]
Returns:

the system information

Return type:

str or None

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

get_translator_credits()[source]
Returns:

The translator credits string

Return type:

str or None

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

get_version()[source]
Returns:

The version string

Return type:

str or None

Returns the version string.

get_website()[source]
Returns:

The website URL

Return type:

str or None

Returns the website URL.

get_website_label()[source]
Returns:

The label used for the website link

Return type:

str or None

Returns the label used for the website link.

get_wrap_license()[source]
Returns:

TRUE if the license text is wrapped

Return type:

bool

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

set_artists(artists)[source]
Parameters:

artists ([str]) – the authors of the artwork of the application

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

set_authors(authors)[source]
Parameters:

authors ([str]) – the authors of the application

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

set_comments(comments)[source]
Parameters:

comments (str or None) – a comments string

Sets the comments string to display in the about dialog.

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

Parameters:

copyright (str or None) – the copyright string

Sets the copyright string to display in the about dialog.

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

set_documenters(documenters)[source]
Parameters:

documenters ([str]) – the authors of the documentation of the application

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

set_license(license)[source]
Parameters:

license (str or None) – the license information

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

If license is NULL, the license page is hidden.

set_license_type(license_type)[source]
Parameters:

license_type (Gtk.License) – the type of license

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

This function overrides the license set using [method`Gtk`.AboutDialog.set_license].

Parameters:

logo (Gdk.Paintable or None) – a GdkPaintable

Sets the logo in the about dialog.

set_logo_icon_name(icon_name)[source]
Parameters:

icon_name (str or None) – an icon name

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

set_program_name(name)[source]
Parameters:

name (str or None) – the program name

Sets the name to display in the about dialog.

If name is not set, the string returned by g_get_application_name() is used.

set_system_information(system_information)[source]
Parameters:

system_information (str or None) – 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 [property`Gtk`.AboutDialog:system-information].

set_translator_credits(translator_credits)[source]
Parameters:

translator_credits (str or None) – the 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:

``c 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.

set_version(version)[source]
Parameters:

version (str or None) – the version string

Sets the version string to display in the about dialog.

set_website(website)[source]
Parameters:

website (str or None) – a URL string starting with http://

Sets the URL to use for the website link.

set_website_label(website_label)[source]
Parameters:

website_label (str) – the label used for the website link

Sets the label to be used for the website link.

set_wrap_license(wrap_license)[source]
Parameters:

wrap_license (bool) – whether to wrap the license

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

Signal Details

Signal Name:

activate-link

Flags:

RUN_LAST

Parameters:
  • about_dialog (Gtk.AboutDialog) – The object which received the signal

  • uri (str) – the URI that is activated

Returns:

TRUE if the link has been activated

Return type:

bool

Emitted every time a URL is activated.

Applications may connect to it to override the default behaviour, which is to call [method`Gtk`.FileLauncher.launch].

Property Details

Gtk.AboutDialog.props.artists
Name:

artists

Type:

[str]

Default Value:

[]

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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.

Gtk.AboutDialog.props.authors
Name:

authors

Type:

[str]

Default Value:

[]

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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.

Gtk.AboutDialog.props.comments
Name:

comments

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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.

Gtk.AboutDialog.props.copyright
Name:

copyright

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Copyright information for the program.

Gtk.AboutDialog.props.documenters
Name:

documenters

Type:

[str]

Default Value:

[]

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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.

Gtk.AboutDialog.props.license
Name:

license

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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 [property`Gtk`.AboutDialog: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.

Gtk.AboutDialog.props.license_type
Name:

license-type

Type:

Gtk.License

Default Value:

Gtk.License.UNKNOWN

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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 [property`Gtk`.AboutDialog:website] property.

If GTK_LICENSE_CUSTOM is used, the current contents of the [property`Gtk`.AboutDialog:license] property are used.

For any other [enum`Gtk`.License] value, the contents of the [property`Gtk`.AboutDialog:license] property are also set by this property as a side effect.

Name:

logo

Type:

Gdk.Paintable

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

A logo for the about box.

If it is NULL, the default window icon set with [id`gtk_window_set_default_icon_name`] will be used.

Gtk.AboutDialog.props.logo_icon_name
Name:

logo-icon-name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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

This property overrides the [property`Gtk`.AboutDialog:logo] property.

Gtk.AboutDialog.props.program_name
Name:

program-name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The name of the program.

If this is not set, it defaults to the value returned by g_get_application_name().

Gtk.AboutDialog.props.system_information
Name:

system-information

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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.

Gtk.AboutDialog.props.translator_credits
Name:

translator-credits

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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.

Gtk.AboutDialog.props.version
Name:

version

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The version of the program.

Gtk.AboutDialog.props.website
Name:

website

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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

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

Gtk.AboutDialog.props.website_label
Name:

website-label

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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

Gtk.AboutDialog.props.wrap_license
Name:

wrap-license

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Whether to wrap the text in the license dialog.