Gnome::Gtk4::AboutDialog
#------------------------------------------------------------------------------- #--[Class Description]---------------------------------------------------------- #-------------------------------------------------------------------------------
=begin rakudoc
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.
=place 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 <[email protected]>. 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
CSS nodes
Gnome::Gtk4::AboutDialog has a single CSS node with the name window and style class .aboutdialog.
Uml Diagram
=end rakudoc =finish
#------------------------------------------------------------------------------- #--[Class Initialization]------------------------------------------------------- #-------------------------------------------------------------------------------
=begin rakudoc
Class initialization
new
:native-object
Create an object using a native object from an object of the same type found elsewhere. See also Gnome::N::TopLevelSupportClass.
multi method new ( N-Object() :$native-object! )
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
new-aboutdialog
Creates a new Gnome::Gtk4::AboutDialog.
method new-aboutdialog ( --> Gnome::Gtk4::AboutDialog )
=end rakudoc
#------------------------------------------------------------------------------- #--[Methods]-------------------------------------------------------------------- #-------------------------------------------------------------------------------
=begin rakudoc
Methods =end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
add-credit-section
Creates a new section in the "Credits" page.
method add-credit-section ( Str $section-name, Array[Str] $people )
$section-name; The name of the section.
$people; The people who belong to that section.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
get-artists
Returns the names of the artists which are displayed in the credits page.
method get-artists (--> Array[Str] )
Return value; A string array containing the artists.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
get-authors
Returns the names of the authors which are displayed in the credits page.
method get-authors (--> Array[Str] )
Return value; A string array containing the authors.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
get-comments
Returns the comments string.
method get-comments (--> Str )
Return value; The comments.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
get-copyright
Returns the copyright string.
method get-copyright (--> Str )
Return value; The copyright string.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
get-documenters
Returns the name of the documenters which are displayed in the credits page.
method get-documenters (--> Array[Str] )
Return value; A string array containing the documenters.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
get-license
Returns the license information.
method get-license (--> Str )
Return value; The license information.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
get-license-type
Retrieves the license type.
method get-license-type (--> GtkLicense )
Return value; a enumeration License from Gnome::Gtk4::T-aboutdialog value.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
get-logo
Returns the paintable displayed as logo in the about dialog.
method get-logo (--> N-Object )
Return value; the paintable displayed as logo or undefined if the logo is unset or has been set via .set-logo-icon-name().
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
get-logo-icon-name
Returns the icon name displayed as logo in the about dialog.
method get-logo-icon-name (--> Str )
Return value; the icon name displayed as logo, or undefined if the logo has been set via .set-logo().
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
get-program-name
Returns the program name displayed in the about dialog.
method get-program-name (--> Str )
Return value; The program name.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
get-system-information
Returns the system information that is shown in the about dialog.
method get-system-information (--> Str )
Return value; the system information.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
get-translator-credits
Returns the translator credits string which is displayed in the credits page.
method get-translator-credits (--> Str )
Return value; The translator credits string.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
get-version
Returns the version string.
method get-version (--> Str )
Return value; The version string.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
get-website
Returns the website URL.
method get-website (--> Str )
Return value; The website URL.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
get-website-label
Returns the label used for the website link.
method get-website-label (--> Str )
Return value; The label used for the website link.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
get-wrap-license
Returns whether the license text in the about dialog is automatically wrapped.
method get-wrap-license (--> Bool )
Return value; True if the license text is wrapped.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
set-artists
Sets the names of the artists to be displayed in the "Credits" page.
method set-artists ( Array[Str] $artists )
$artists; the authors of the artwork of the application.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
set-authors
Sets the names of the authors which are displayed in the "Credits" page of the about dialog.
method set-authors ( Array[Str] $authors )
$authors; the authors of the application.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
set-comments
Sets the comments string to display in the about dialog.
This should be a short string of one or two lines.
method set-comments ( Str $comments )
$comments; a comments string.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
set-copyright
Sets the copyright string to display in the about dialog.
This should be a short string of one or two lines.
method set-copyright ( Str $copyright )
$copyright; the copyright string.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
set-documenters
Sets the names of the documenters which are displayed in the "Credits" page.
method set-documenters ( Array[Str] $documenters )
$documenters; the authors of the documentation of the application.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
set-license
Sets the license information to be displayed in the about dialog.
If license is undefined, the license page is hidden.
method set-license ( Str $license )
$license; the license information.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
set-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 .set-license().
method set-license-type ( GtkLicense $license-type )
$license-type; the type of license.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
set-logo
Sets the logo in the about dialog.
method set-logo ( N-Object() $logo )
$logo; a Gnome::Gdk4::R-Paintable.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
set-logo-icon-name
Sets $icon-name to be displayed as logo in the about dialog.
method set-logo-icon-name ( Str $icon-name )
$icon-name; an icon name.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
set-program-name
Sets the name to display in the about dialog.
If $name is not set, the string returned by Gnome::Glib::T-utils()` is used.
method set-program-name ( Str $name )
$name; the program name.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
set-system-information
Sets the system information to be displayed in the about dialog.
If system_information is undefined, the system information page is hidden.
See system-information.
method set-system-information ( Str $system-information )
$system-information; system information.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
set-translator-credits
Sets the translator credits string which is displayed in the credits page.
method set-translator-credits ( Str $translator-credits )
$translator-credits; the translator credits.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
set-version
Sets the version string to display in the about dialog.
method set-version ( Str $version )
$version; the version string.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
set-website
Sets the URL to use for the website link.
method set-website ( Str $website )
$website; a URL string starting with http://`.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
set-website-label
Sets the label to be used for the website link.
method set-website-label ( Str $website-label )
$website-label; the label used for the website link.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
set-wrap-license
Sets whether the license text in the about dialog should be automatically wrapped.
method set-wrap-license ( Bool() $wrap-license )
$wrap-license; whether to wrap the license.
=end rakudoc
#------------------------------------------------------------------------------- #--[Signal Documentation]------------------------------------------------------- #-------------------------------------------------------------------------------
=begin rakudoc
Signals
activate-link
Emitted every time a URL is activated.
Applications may connect to it to override the default behaviour, which is to call .launch() in class FileLauncher.
method handler (
Str $uri,
Int :$_handle_id,
N-GObject :$_native-object,
*%user-options
--> gboolean
)
$uri; the URI that is activated.
$_handle_id; The registered event handler id.
$_native-object; The native object provided by the Raku object which registered this event. This is a native Gnome::Gtk4::AboutDialog object.
%user-options; A list of named arguments provided by .register-signal() in class Object.
Return value; True if the link has been activated
=end rakudoc