Class AboutDialog

All Implemented Interfaces:
PointerInterface

public class AboutDialog extends Window
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 GtkAboutDialog](aboutdialog.png)

About dialogs often contain links and email addresses. `GtkAboutDialog`
displays these as clickable links. By default, it calls [func@Gtk.show_uri]
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
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);
```

## CSS nodes

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

https://docs.gtk.org/gtk4/class.AboutDialog.html

  • Field Details

  • Constructor Details

    • AboutDialog

      public AboutDialog(PointerContainer pointer)
    • AboutDialog

      public AboutDialog()
      Creates a new `GtkAboutDialog`.
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • addCreditSection

      public void addCreditSection(@Nonnull Str section_name, @Nonnull Strs people)
      Creates a new section in the "Credits" page.
      Parameters:
      section_name - The name of the section
      people - The people who belong to that section
    • addCreditSection

      public void addCreditSection(String section_name, @Nonnull Strs people)
      Creates a new section in the "Credits" page.
      Parameters:
      section_name - The name of the section
      people - The people who belong to that section
    • getArtists

      public Strs getArtists()
      Returns the names of the artists which are displayed
      in the credits page.
      Returns:
      A `NULL`-terminated string array containing the artists
    • getAuthors

      public Strs getAuthors()
      Returns the names of the authors which are displayed
      in the credits page.
      Returns:
      A `NULL`-terminated string array containing the authors
    • getComments

      public Str getComments()
      Returns the comments string.
      Returns:
      The comments
    • getCopyright

      public Str getCopyright()
      Returns the copyright string.
      Returns:
      The copyright string
    • getDocumenters

      public Strs getDocumenters()
      Returns the name of the documenters which are displayed
      in the credits page.
      Returns:
      A `NULL`-terminated string array containing the documenters
    • getLicense

      public Str getLicense()
      Returns the license information.
      Returns:
      The license information
    • getLicenseType

      public int getLicenseType()
      Retrieves the license type.
      Returns:
      a [enum@Gtk.License] value
    • getLogo

      public Paintable getLogo()
      Returns the paintable displayed as logo in the about dialog.
      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]
    • getLogoIconName

      public Str getLogoIconName()
      Returns the icon name displayed as logo in the about dialog.
      Returns:
      the icon name displayed as logo, or `NULL` if the logo has been set via [method@Gtk.AboutDialog.set_logo]
    • getProgramName

      public Str getProgramName()
      Returns the program name displayed in the about dialog.
      Returns:
      The program name
    • getSystemInformation

      public Str getSystemInformation()
      Returns the system information that is shown in the about dialog.
      Returns:
      the system information
    • getTranslatorCredits

      public Str getTranslatorCredits()
      Returns the translator credits string which is displayed
      in the credits page.
      Returns:
      The translator credits string
    • getVersion

      public Str getVersion()
      Returns the version string.
      Returns:
      The version string
    • getWebsite

      public Str getWebsite()
      Returns the website URL.
      Returns:
      The website URL
    • getWebsiteLabel

      public Str getWebsiteLabel()
      Returns the label used for the website link.
      Returns:
      The label used for the website link
    • getWrapLicense

      public boolean getWrapLicense()
      Returns whether the license text in the about dialog is
      automatically wrapped.
      Returns:
      `TRUE` if the license text is wrapped
    • setArtists

      public void setArtists(@Nonnull Strs artists)
      Sets the names of the artists to be displayed
      in the "Credits" page.
      Parameters:
      artists - the authors of the artwork of the application
    • setAuthors

      public void setAuthors(@Nonnull Strs authors)
      Sets the names of the authors which are displayed
      in the "Credits" page of the about dialog.
      Parameters:
      authors - the authors of the application
    • setComments

      public void setComments(@Nullable Str comments)
      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
    • setComments

      public void setComments(String comments)
      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
    • setCopyright

      public void setCopyright(@Nullable Str copyright)
      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
    • setCopyright

      public void setCopyright(String copyright)
      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
    • setDocumenters

      public void setDocumenters(@Nonnull Strs documenters)
      Sets the names of the documenters which are displayed
      in the "Credits" page.
      Parameters:
      documenters - the authors of the documentation of the application
    • setLicense

      public void setLicense(@Nullable Str license)
      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
    • setLicense

      public void setLicense(String license)
      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
    • setLicenseType

      public void setLicenseType(int 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
      [method@Gtk.AboutDialog.set_license].
      Parameters:
      license_type - the type of license
    • setLogo

      public void setLogo(@Nullable Paintable logo)
      Sets the logo in the about dialog.
      Parameters:
      logo - a `GdkPaintable`
    • setLogoIconName

      public void setLogoIconName(@Nullable Str icon_name)
      Sets the icon name to be displayed as logo in the about dialog.
      Parameters:
      icon_name - an icon name
    • setLogoIconName

      public void setLogoIconName(String icon_name)
      Sets the icon name to be displayed as logo in the about dialog.
      Parameters:
      icon_name - an icon name
    • setProgramName

      public void setProgramName(@Nullable Str 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.
      Parameters:
      name - the program name
    • setProgramName

      public void setProgramName(String 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.
      Parameters:
      name - the program name
    • setSystemInformation

      public void setSystemInformation(@Nullable Str 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].
      Parameters:
      system_information - system information
    • setSystemInformation

      public void setSystemInformation(String 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].
      Parameters:
      system_information - system information
    • setTranslatorCredits

      public void setTranslatorCredits(@Nullable Str 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.
      Parameters:
      translator_credits - the translator credits
    • setTranslatorCredits

      public void setTranslatorCredits(String 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.
      Parameters:
      translator_credits - the translator credits
    • setVersion

      public void setVersion(@Nullable Str version)
      Sets the version string to display in the about dialog.
      Parameters:
      version - the version string
    • setVersion

      public void setVersion(String version)
      Sets the version string to display in the about dialog.
      Parameters:
      version - the version string
    • setWebsite

      public void setWebsite(@Nullable Str website)
      Sets the URL to use for the website link.
      Parameters:
      website - a URL string starting with `http://`
    • setWebsite

      public void setWebsite(String website)
      Sets the URL to use for the website link.
      Parameters:
      website - a URL string starting with `http://`
    • setWebsiteLabel

      public void setWebsiteLabel(@Nonnull Str website_label)
      Sets the label to be used for the website link.
      Parameters:
      website_label - the label used for the website link
    • setWebsiteLabel

      public void setWebsiteLabel(String website_label)
      Sets the label to be used for the website link.
      Parameters:
      website_label - the label used for the website link
    • setWrapLicense

      public void setWrapLicense(boolean wrap_license)
      Sets whether the license text in the about dialog should be
      automatically wrapped.
      Parameters:
      wrap_license - whether to wrap the license
    • onActivateLink

      public SignalHandler onActivateLink(AboutDialog.OnActivateLink signal)
      Connect to signal "activate-link".
      See AboutDialog.OnActivateLink.onActivateLink(ch.bailu.gtk.type.Str) for signal description.
      Field SIGNAL_ON_ACTIVATE_LINK contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • asAccessible

      public Accessible asAccessible()
      Implements interface Accessible. Call this to get access to interface functions.
      Overrides:
      asAccessible in class Window
      Returns:
      Accessible
    • asBuildable

      public Buildable asBuildable()
      Implements interface Buildable. Call this to get access to interface functions.
      Overrides:
      asBuildable in class Window
      Returns:
      Buildable
    • asConstraintTarget

      public ConstraintTarget asConstraintTarget()
      Implements interface ConstraintTarget. Call this to get access to interface functions.
      Overrides:
      asConstraintTarget in class Window
      Returns:
      ConstraintTarget
    • asNative

      public Native asNative()
      Implements interface Native. Call this to get access to interface functions.
      Overrides:
      asNative in class Window
      Returns:
      Native
    • asRoot

      public Root asRoot()
      Implements interface Root. Call this to get access to interface functions.
      Overrides:
      asRoot in class Window
      Returns:
      Root
    • asShortcutManager

      public ShortcutManager asShortcutManager()
      Implements interface ShortcutManager. Call this to get access to interface functions.
      Overrides:
      asShortcutManager in class Window
      Returns:
      ShortcutManager
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()