Skip to content

Gtk.AboutDialog

class — extends Window, Accessible, Buildable, ConstraintTarget, Native, Root, ShortcutManager

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.

<picture> <source srcset="aboutdialot-dark.png" media="(prefers-color-scheme: dark)"> <img alt="An example GtkAboutDialog" src="aboutdialog.png"> </picture>

About dialogs often contain links and email addresses. GtkAboutDialog displays these as clickable links. By default, it calls FileLauncher.launch when a user clicks one. The behaviour can be overridden with the 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 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:

  • <kbd>Escape</kbd> closes the window.

CSS nodes

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

Constructors

new

@classmethod
def new(cls) -> Widget

Creates a new GtkAboutDialog.

Methods

add_credit_section

def add_credit_section(self, section_name: str, people: list[str]) -> None

Creates a new section in the "Credits" page.

Parameters:

  • section_name — The name of the section
  • people — the people who belong to that section

get_artists

def get_artists(self) -> list[str]

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

get_authors

def get_authors(self) -> list[str]

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

get_comments

def get_comments(self) -> str | None

Returns the comments string.

def get_copyright(self) -> str | None

Returns the copyright string.

get_documenters

def get_documenters(self) -> list[str]

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

get_license

def get_license(self) -> str | None

Returns the license information.

get_license_type

def get_license_type(self) -> License

Retrieves the license type.

def get_logo(self) -> Gdk.Paintable | None

Returns the paintable displayed as logo in the about dialog.

get_logo_icon_name

def get_logo_icon_name(self) -> str | None

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

get_program_name

def get_program_name(self) -> str | None

Returns the program name displayed in the about dialog.

get_system_information

def get_system_information(self) -> str | None

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

get_translator_credits

def get_translator_credits(self) -> str | None

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

get_version

def get_version(self) -> str | None

Returns the version string.

get_website

def get_website(self) -> str | None

Returns the website URL.

get_website_label

def get_website_label(self) -> str | None

Returns the label used for the website link.

get_wrap_license

def get_wrap_license(self) -> bool

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

set_artists

def set_artists(self, artists: list[str]) -> None

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

Parameters:

  • artists — the authors of the artwork of the application

set_authors

def set_authors(self, authors: list[str]) -> None

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

Parameters:

  • authors — the authors of the application

set_comments

def set_comments(self, comments: str | None = ...) -> None

Sets the comments string to display in the about dialog.

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

Parameters:

  • comments — a comments string
def set_copyright(self, copyright: str | None = ...) -> None

Sets the copyright string to display in the about dialog.

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

Parameters:

  • copyright — the copyright string

set_documenters

def set_documenters(self, documenters: list[str]) -> None

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

Parameters:

  • documenters — the authors of the documentation of the application

set_license

def set_license(self, license: str | None = ...) -> None

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

If license is NULL, the license page is hidden.

Parameters:

  • license — the license information

set_license_type

def set_license_type(self, license_type: License | int) -> None

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

This function overrides the license set using AboutDialog.set_license.

Parameters:

  • license_type — the type of license
def set_logo(self, logo: Gdk.Paintable | None = ...) -> None

Sets the logo in the about dialog.

Parameters:

  • logo — a GdkPaintable

set_logo_icon_name

def set_logo_icon_name(self, icon_name: str | None = ...) -> None

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

Parameters:

  • icon_name — an icon name

set_program_name

def set_program_name(self, name: str | None = ...) -> None

Sets the name to display in the about dialog.

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

Parameters:

  • name — the program name

set_system_information

def set_system_information(self, system_information: str | None = ...) -> None

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

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

See AboutDialog.system-information.

Parameters:

  • system_information — system information

set_translator_credits

def set_translator_credits(self, translator_credits: str | None = ...) -> None

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.

Parameters:

  • translator_credits — the translator credits

set_version

def set_version(self, version: str | None = ...) -> None

Sets the version string to display in the about dialog.

Parameters:

  • version — the version string

set_website

def set_website(self, website: str | None = ...) -> None

Sets the URL to use for the website link.

Parameters:

  • website — a URL string starting with http://

set_website_label

def set_website_label(self, website_label: str) -> None

Sets the label to be used for the website link.

Parameters:

  • website_label — the label used for the website link

set_wrap_license

def set_wrap_license(self, wrap_license: bool) -> None

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

Parameters:

  • wrap_license — whether to wrap the license

Properties

artists

artists: list[str]  # read/write

The people who contributed artwork to the program.

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

authors

authors: list[str]  # read/write

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.

comments

comments: str  # read/write

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.

copyright: str  # read/write

Copyright information for the program.

documenters

documenters: list[str]  # read/write

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.

license

license: str  # read/write

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 AboutDialog.license-type property is set to 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.

license_type

license_type: License | int  # read/write

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 License.unknown is used, the link used will be the same specified in the AboutDialog.website property.

If License.custom is used, the current contents of the AboutDialog.license property are used.

For any other License value, the contents of the AboutDialog.license property are also set by this property as a side effect.

logo: Gdk.Paintable  # read/write

A logo for the about box.

If it is NULL, the default window icon set with Window.set_default_icon_name will be used.

logo_icon_name

logo_icon_name: str  # read/write

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

This property overrides the AboutDialog.logo property.

program_name

program_name: str  # read/write

The name of the program.

If this is not set, it defaults to the value returned by GLib.get_application_name.

system_information

system_information: str  # read/write

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.

translator_credits

translator_credits: str  # read/write

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.

version

version: str  # read/write

The version of the program.

website

website: str  # read/write

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

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

website_label

website_label: str  # read/write

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

wrap_license

wrap_license: bool  # read/write

Whether to wrap the text in the license dialog.

Signals

def on_activate_link(self, uri: str) -> bool: ...

Emitted every time a URL is activated.

Applications may connect to it to override the default behaviour, which is to call FileLauncher.launch.