:right-sidebar: True AboutDialog =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: AboutDialog(*args, **kwargs) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.Window`, :class:`~gi.repository.Gtk.Widget`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gtk.Accessible`, :class:`~gi.repository.Gtk.Buildable`, :class:`~gi.repository.Gtk.ConstraintTarget`, :class:`~gi.repository.Gtk.Native`, :class:`~gi.repository.Gtk.Root`, :class:`~gi.repository.Gtk.ShortcutManager` 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. .. image:: https://docs.gtk.org/gtk4/aboutdialog.png About dialogs often contain links and email addresses. ``GtkAboutDialog`` displays these as clickable links. By default, it calls :obj:`~gi.repository.Gtk.FileLauncher.launch` when a user clicks one. The behaviour can be overridden with the :obj:`~gi.repository.Gtk.AboutDialog.signals.activate_link` signal. To specify a person with an email address, use a string like ``Edgar Allan Poe ``\. 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 :obj:`~gi.repository.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: .. code-block:: c :dedent: 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` closes the window. CSS nodes -------------------------------------------------------------------------------- ``GtkAboutDialog`` has a single CSS node with the name ``window`` and style class ``.aboutdialog``\. Constructors ------------ .. rst-class:: interim-class .. class:: AboutDialog :no-index: .. classmethod:: new() -> ~gi.repository.Gtk.Widget Creates a new ``GtkAboutDialog``\. Methods ------- .. rst-class:: interim-class .. class:: AboutDialog :no-index: .. method:: add_credit_section(section_name: str, people: list[str]) -> None Creates a new section in the "Credits" page. :param section_name: The name of the section :param people: The people who belong to that section .. method:: get_artists() -> list[str] Returns the names of the artists which are displayed in the credits page. .. method:: get_authors() -> list[str] Returns the names of the authors which are displayed in the credits page. .. method:: get_comments() -> str | None Returns the comments string. .. method:: get_copyright() -> str | None Returns the copyright string. .. method:: get_documenters() -> list[str] Returns the name of the documenters which are displayed in the credits page. .. method:: get_license() -> str | None Returns the license information. .. method:: get_license_type() -> ~gi.repository.Gtk.License Retrieves the license type. .. method:: get_logo() -> ~gi.repository.Gdk.Paintable | None Returns the paintable displayed as logo in the about dialog. .. method:: get_logo_icon_name() -> str | None Returns the icon name displayed as logo in the about dialog. .. method:: get_program_name() -> str | None Returns the program name displayed in the about dialog. .. method:: get_system_information() -> str | None Returns the system information that is shown in the about dialog. .. method:: get_translator_credits() -> str | None Returns the translator credits string which is displayed in the credits page. .. method:: get_version() -> str | None Returns the version string. .. method:: get_website() -> str | None Returns the website URL. .. method:: get_website_label() -> str | None Returns the label used for the website link. .. method:: get_wrap_license() -> bool Returns whether the license text in the about dialog is automatically wrapped. .. method:: set_artists(artists: list[str]) -> None Sets the names of the artists to be displayed in the "Credits" page. :param artists: the authors of the artwork of the application .. method:: set_authors(authors: list[str]) -> None Sets the names of the authors which are displayed in the "Credits" page of the about dialog. :param authors: the authors of the application .. method:: set_comments(comments: str | None = None) -> None Sets the comments string to display in the about dialog. This should be a short string of one or two lines. :param comments: a comments string .. method:: set_copyright(copyright: str | None = None) -> None Sets the copyright string to display in the about dialog. This should be a short string of one or two lines. :param copyright: the copyright string .. method:: set_documenters(documenters: list[str]) -> None Sets the names of the documenters which are displayed in the "Credits" page. :param documenters: the authors of the documentation of the application .. method:: set_license(license: str | None = None) -> None Sets the license information to be displayed in the about dialog. If ``license`` is ``NULL``\, the license page is hidden. :param license: the license information .. method:: set_license_type(license_type: ~gi.repository.Gtk.License) -> None Sets the license of the application showing the about dialog from a list of known licenses. This function overrides the license set using :obj:`~gi.repository.Gtk.AboutDialog.set_license`\. :param license_type: the type of license .. method:: set_logo(logo: ~gi.repository.Gdk.Paintable | None = None) -> None Sets the logo in the about dialog. :param logo: a ``GdkPaintable`` .. method:: set_logo_icon_name(icon_name: str | None = None) -> None Sets the icon name to be displayed as logo in the about dialog. :param icon_name: an icon name .. method:: set_program_name(name: str | None = 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. :param name: the program name .. method:: set_system_information(system_information: str | None = 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 :obj:`~gi.repository.Gtk.AboutDialog.props.system_information`\. :param system_information: system information .. method:: set_translator_credits(translator_credits: str | None = 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: .. code-block:: c :dedent: 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. :param translator_credits: the translator credits .. method:: set_version(version: str | None = None) -> None Sets the version string to display in the about dialog. :param version: the version string .. method:: set_website(website: str | None = None) -> None Sets the URL to use for the website link. :param website: a URL string starting with ``http://`` .. method:: set_website_label(website_label: str) -> None Sets the label to be used for the website link. :param website_label: the label used for the website link .. method:: set_wrap_license(wrap_license: bool) -> None Sets whether the license text in the about dialog should be automatically wrapped. :param wrap_license: whether to wrap the license Properties ---------- .. rst-class:: interim-class .. class:: AboutDialog :no-index: .. attribute:: props.artists :type: list[str] The type of the None singleton. .. attribute:: props.authors :type: list[str] The type of the None singleton. .. attribute:: props.comments :type: str The type of the None singleton. .. attribute:: props.copyright :type: str The type of the None singleton. .. attribute:: props.documenters :type: list[str] The type of the None singleton. .. attribute:: props.license :type: str The type of the None singleton. .. attribute:: props.license_type :type: ~gi.repository.Gtk.License The type of the None singleton. .. attribute:: props.logo :type: ~gi.repository.Gdk.Paintable The type of the None singleton. .. attribute:: props.logo_icon_name :type: str The type of the None singleton. .. attribute:: props.program_name :type: str The type of the None singleton. .. attribute:: props.system_information :type: str The type of the None singleton. .. attribute:: props.translator_credits :type: str The type of the None singleton. .. attribute:: props.version :type: str The type of the None singleton. .. attribute:: props.website :type: str The type of the None singleton. .. attribute:: props.website_label :type: str The type of the None singleton. .. attribute:: props.wrap_license :type: bool The type of the None singleton. Signals ------- .. rst-class:: interim-class .. class:: AboutDialog.signals :no-index: .. method:: activate_link(uri: str) -> bool The type of the None singleton. :param uri: the URI that is activated