About my projects, examples and tutorials
Gnome::Gtk4::AboutDialog

Gnome::Gtk4::AboutDialog

Table of Contents

Description§

The Gnome::Gtk4::AboutDialog 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.

UNKNOWN image§

=for image :class<inline> :src<asset_files/images/aboutdialog.png> :width<30\%>

Placement§

No file found at ļ½¢file://asset_files/images/aboutdialog.pngļ½£

About dialogs often contain links and email addresses. <Gnome::Gtk4::AboutDialog> displays these as clickable links. By default, it calls .launch() in class FileLauncher 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 https://www.gtk.org.

To make constructing a Gnome::Gtk4::AboutDialog as convenient as possible, you can use the function .show-about-dialog() in package Gnome::Gtk4::T-aboutdialog 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 Gnome::Gtk4::AboutDialog, as shown in the following example:

use Gnome::Gtk4::Window:api<2>;
use Gnome::Gtk4::AboutDialog:api<2>;
use Gnome::Gtk4::T-AboutDialog:api<2>;

my Gnome::Gtk4::Window $window .= new-window;

my Gnome::Gtk4::AboutDialog $about .= new-aboutdialog;
$about.set-transient-for($window);
$about.set-version('0.21.4');
$about.set-license-type(GTK_LICENSE_ARTISTIC);

# Normally run() is started by a menu select or button click
$about.run;   # application stays in $about in separate event loop
$about.hide;  # application returns here when buttons
              # on dialog are pressed
Code

CSS nodes§

Gnome::Gtk4::AboutDialog has a single CSS node with the name window and style class .aboutdialog.

Uml Diagram§

UNKNOWN image§

=for image :class<inline> :src<asset_files/images/plantuml/AboutDialog.png> :width<70\%>