Gtk.About_Dialog

Entities

Simple Types

Tagged Types

Access Types

Constants

Subprograms

Generic Instantiations

Description

The GtkAboutDialog offers a simple way to display information about a program like its 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.

About dialogs often contain links and email addresses. GtkAboutDialog displays these as clickable links. By default, it calls gtk_show_uri_on_window when a user clicks one. The behaviour can be overridden with the Gtk.About_Dialog.Gtk_About_Dialog::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 http://www.gtk.org".

To make constructing a GtkAboutDialog 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 a GtkAboutDialog, as shown in the following example:

GdkPixbuf *example_logo = gdk_pixbuf_new_from_file ("./logo.png", NULL);
gtk_show_about_dialog (NULL,
                       "program-name", "ExampleCode",
                       "logo", example_logo,
                       "title", _("About ExampleCode"),
                       NULL);

It is also possible to show a Gtk.About_Dialog.Gtk_About_Dialog like any other Gtk.Dialog.Gtk_Dialog, e.g. using Gtk.Dialog.Run. In this case, you might need to know that the "Close" button returns the GTK_RESPONSE_CANCEL response id.

<group>Windows</group> <testgtk>create_about.adb</testgtk>

"+"

function "+"
  (Widget : access Gtk_About_Dialog_Record'Class)
return Gtk.Buildable.Gtk_Buildable
Parameters
Widget
Return Value

"-"

function "-"
  (Interf : Gtk.Buildable.Gtk_Buildable)
return Gtk_About_Dialog
Parameters
Interf
Return Value

Add_Credit_Section

procedure Add_Credit_Section
   (About        : not null access Gtk_About_Dialog_Record;
    Section_Name : UTF8_String;
    People       : GNAT.Strings.String_List)

Creates a new section in the Credits page. Since: gtk+ 3.4

Parameters
About
Section_Name

The name of the section

People

The people who belong to that section

Artists_Property

Artists_Property : constant Glib.Properties.Property_String :=
Glib.Properties.Build ("artists");

Unknown type: unspecified

Authors_Property

Authors_Property : constant Glib.Properties.Property_String :=
Glib.Properties.Build ("authors");

Unknown type: unspecified

Cb_GObject_UTF8_String_Boolean

type Cb_GObject_UTF8_String_Boolean is not null access function
  (Self : access Glib.Object.GObject_Record'Class;
   URI  : UTF8_String) return Boolean;
Parameters
Self
URI
Return Value

Cb_Gtk_About_Dialog_UTF8_String_Boolean

type Cb_Gtk_About_Dialog_UTF8_String_Boolean is not null access function
  (Self : access Gtk_About_Dialog_Record'Class;
   URI  : UTF8_String) return Boolean;
Parameters
Self
URI
Return Value

Comments_Property

Comments_Property : constant Glib.Properties.Property_String;

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_Property

Copyright_Property : constant Glib.Properties.Property_String;

Copyright information for the program.

Documenters_Property

Documenters_Property : constant Glib.Properties.Property_String :=
Glib.Properties.Build ("documenters");

Unknown type: unspecified

Get_Artists

function Get_Artists
   (About : not null access Gtk_About_Dialog_Record)
    return GNAT.Strings.String_List

Returns the string which are displayed in the artists tab of the secondary credits dialog. Since: gtk+ 2.6

Parameters
About
Return Value

A null-terminated string array containing the artists. The array is owned by the about dialog and must not be modified.

Get_Authors

function Get_Authors
   (About : not null access Gtk_About_Dialog_Record)
    return GNAT.Strings.String_List

Returns the string which are displayed in the authors tab of the secondary credits dialog. Since: gtk+ 2.6

Parameters
About
Return Value

A null-terminated string array containing the authors. The array is owned by the about dialog and must not be modified.

Get_Comments

function Get_Comments
   (About : not null access Gtk_About_Dialog_Record) return UTF8_String

Returns the comments string. Since: gtk+ 2.6

Parameters
About
Return Value

The comments. The string is owned by the about dialog and must not be modified.

Get_Copyright

function Get_Copyright
   (About : not null access Gtk_About_Dialog_Record) return UTF8_String

Returns the copyright string. Since: gtk+ 2.6

Parameters
About
Return Value

The copyright string. The string is owned by the about dialog and must not be modified.

Get_Documenters

function Get_Documenters
   (About : not null access Gtk_About_Dialog_Record)
    return GNAT.Strings.String_List

Returns the string which are displayed in the documenters tab of the secondary credits dialog. Since: gtk+ 2.6

Parameters
About
Return Value

A null-terminated string array containing the documenters. The array is owned by the about dialog and must not be modified.

Get_License

function Get_License
   (About : not null access Gtk_About_Dialog_Record) return UTF8_String

Returns the license information. Since: gtk+ 2.6

Parameters
About
Return Value

The license information. The string is owned by the about dialog and must not be modified.

Get_License_Type

function Get_License_Type
   (About : not null access Gtk_About_Dialog_Record) return Gtk_License

Retrieves the license set using Gtk.About_Dialog.Set_License_Type Since: gtk+ 3.0

Parameters
About
Return Value

a Gtk.About_Dialog.Gtk_License value

Get_Logo

function Get_Logo
   (About : not null access Gtk_About_Dialog_Record)
    return Gdk.Pixbuf.Gdk_Pixbuf

Returns the pixbuf displayed as logo in the about dialog. Since: gtk+ 2.6

Parameters
About
Return Value

the pixbuf displayed as logo. The pixbuf is owned by the about dialog. If you want to keep a reference to it, you have to call g_object_ref on it.

Get_Logo_Icon_Name

function Get_Logo_Icon_Name
   (About : not null access Gtk_About_Dialog_Record) return UTF8_String

Returns the icon name displayed as logo in the about dialog. Since: gtk+ 2.6

Parameters
About
Return Value

the icon name displayed as logo. The string is owned by the dialog. If you want to keep a reference to it, you have to call g_strdup on it.

Get_Program_Name

function Get_Program_Name
   (About : not null access Gtk_About_Dialog_Record) return UTF8_String

Returns the program name displayed in the about dialog. Since: gtk+ 2.12

Parameters
About
Return Value

The program name. The string is owned by the about dialog and must not be modified.

Get_Translator_Credits

function Get_Translator_Credits
   (About : not null access Gtk_About_Dialog_Record) return UTF8_String

Returns the translator credits string which is displayed in the translators tab of the secondary credits dialog. Since: gtk+ 2.6

Parameters
About
Return Value

The translator credits string. The string is owned by the about dialog and must not be modified.

Get_Type

function Get_Type return Glib.GType
Return Value

Get_Version

function Get_Version
   (About : not null access Gtk_About_Dialog_Record) return UTF8_String

Returns the version string. Since: gtk+ 2.6

Parameters
About
Return Value

The version string. The string is owned by the about dialog and must not be modified.

Get_Website

function Get_Website
   (About : not null access Gtk_About_Dialog_Record) return UTF8_String

Returns the website URL. Since: gtk+ 2.6

Parameters
About
Return Value

The website URL. The string is owned by the about dialog and must not be modified.

Get_Website_Label

function Get_Website_Label
   (About : not null access Gtk_About_Dialog_Record) return UTF8_String

Returns the label used for the website link. Since: gtk+ 2.6

Parameters
About
Return Value

The label used for the website link. The string is owned by the about dialog and must not be modified.

Get_Wrap_License

function Get_Wrap_License
   (About : not null access Gtk_About_Dialog_Record) return Boolean

Returns whether the license text in About is automatically wrapped. Since: gtk+ 2.8

Parameters
About
Return Value

True if the license text is wrapped

Gtk_About_Dialog

type Gtk_About_Dialog is access all Gtk_About_Dialog_Record'Class;

Gtk_About_Dialog_New

function Gtk_About_Dialog_New return Gtk_About_Dialog

Creates a new Gtk.About_Dialog.Gtk_About_Dialog. Since: gtk+ 2.6

Return Value

Gtk_About_Dialog_Record

type Gtk_About_Dialog_Record is new Gtk_Dialog_Record with null record;

Gtk_License

type Gtk_License is (
   License_Unknown,
   License_Custom,
   License_Gpl_2_0,
   License_Gpl_3_0,
   License_Lgpl_2_1,
   License_Lgpl_3_0,
   License_Bsd,
   License_Mit_X11,
   …,
   License_Mpl_2_0);

The type of license for an application.

This enumeration can be expanded at later date.

Enumeration Literal
License_Unknown
License_Custom
License_Gpl_2_0
License_Gpl_3_0
License_Lgpl_2_1
License_Lgpl_3_0
License_Bsd
License_Mit_X11
License_Artistic
License_Gpl_2_0_Only
License_Gpl_3_0_Only
License_Lgpl_2_1_Only
License_Lgpl_3_0_Only
License_Agpl_3_0
License_Agpl_3_0_Only
License_Bsd_3
License_Apache_2_0
License_Mpl_2_0

Gtk_License_Properties

package Gtk_License_Properties is
   new Generic_Internal_Discrete_Property (Gtk_License);

Gtk_New

procedure Gtk_New (About : out Gtk_About_Dialog)

Creates a new Gtk.About_Dialog.Gtk_About_Dialog. Since: gtk+ 2.6 Initialize does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
About

Implements_Gtk_Buildable

package Implements_Gtk_Buildable is new Glib.Types.Implements
  (Gtk.Buildable.Gtk_Buildable, Gtk_About_Dialog_Record, Gtk_About_Dialog);

Initialize

procedure Initialize
   (About : not null access Gtk_About_Dialog_Record'Class)

Creates a new Gtk.About_Dialog.Gtk_About_Dialog. Since: gtk+ 2.6 Initialize does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
About

License_Property

License_Property : constant Glib.Properties.Property_String;

The license of the program. 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 Gtk.About_Dialog.Gtk_About_Dialog:license-type property is set to Gtk.About_Dialog.License_Custom as a side effect.

License_Type_Property

License_Type_Property : constant Gtk.About_Dialog.Property_Gtk_License;

Type: Gtk_License The license of the program, as a value of the GtkLicense enumeration.

The Gtk.About_Dialog.Gtk_About_Dialog will automatically fill out a standard disclaimer and link the user to the appropriate online resource for the license text.

If Gtk.About_Dialog.License_Unknown is used, the link used will be the same specified in the Gtk.About_Dialog.Gtk_About_Dialog:website property.

If Gtk.About_Dialog.License_Custom is used, the current contents of the Gtk.About_Dialog.Gtk_About_Dialog:license property are used.

For any other Gtk.About_Dialog.Gtk_License value, the contents of the Gtk.About_Dialog.Gtk_About_Dialog:license property are also set by this property as a side effect.

Logo_Icon_Name_Property

Logo_Icon_Name_Property : constant Glib.Properties.Property_String;

A named icon to use as the logo for the about box. This property overrides the Gtk.About_Dialog.Gtk_About_Dialog:logo property.

Logo_Property

Logo_Property : constant Glib.Properties.Property_Object;

Type: Gdk.Pixbuf.Gdk_Pixbuf A logo for the about box. If it is null, the default window icon set with Gtk.Window.Set_Default_Icon will be used.

On_Activate_Link

procedure On_Activate_Link
   (Self  : not null access Gtk_About_Dialog_Record;
    Call  : Cb_GObject_UTF8_String_Boolean;
    Slot  : not null access Glib.Object.GObject_Record'Class;
    After : Boolean := False)

The signal which gets emitted to activate a URI. Applications may connect to it to override the default behaviour, which is to call gtk_show_uri_on_window.

Callback parameters: -- @param URI the URI that is activated

Parameters
Self
Call
Slot
After

On_Activate_Link

procedure On_Activate_Link
   (Self  : not null access Gtk_About_Dialog_Record;
    Call  : Cb_Gtk_About_Dialog_UTF8_String_Boolean;
    After : Boolean := False)

The signal which gets emitted to activate a URI. Applications may connect to it to override the default behaviour, which is to call gtk_show_uri_on_window.

Callback parameters: -- @param URI the URI that is activated

Parameters
Self
Call
After

Program_Name_Property

Program_Name_Property : constant Glib.Properties.Property_String;

The name of the program. If this is not set, it defaults to g_get_application_name.

Property_Gtk_License

type Property_Gtk_License is new Gtk_License_Properties.Property;

Set_Artists

procedure Set_Artists
   (About   : not null access Gtk_About_Dialog_Record;
    Artists : GNAT.Strings.String_List)

Sets the strings which are displayed in the artists tab of the secondary credits dialog. Since: gtk+ 2.6

Parameters
About
Artists

a null-terminated array of strings

Set_Authors

procedure Set_Authors
   (About   : not null access Gtk_About_Dialog_Record;
    Authors : GNAT.Strings.String_List)

Sets the strings which are displayed in the authors tab of the secondary credits dialog. Since: gtk+ 2.6

Parameters
About
Authors

a null-terminated array of strings

Set_Comments

procedure Set_Comments
   (About    : not null access Gtk_About_Dialog_Record;
    Comments : UTF8_String := "")

Sets the comments string to display in the about dialog. This should be a short string of one or two lines. Since: gtk+ 2.6

Parameters
About
Comments

a comments string

Set_Copyright

procedure Set_Copyright
   (About     : not null access Gtk_About_Dialog_Record;
    Copyright : UTF8_String := "")

Sets the copyright string to display in the about dialog. This should be a short string of one or two lines. Since: gtk+ 2.6

Parameters
About
Copyright

the copyright string

Set_Documenters

procedure Set_Documenters
   (About       : not null access Gtk_About_Dialog_Record;
    Documenters : GNAT.Strings.String_List)

Sets the strings which are displayed in the documenters tab of the secondary credits dialog. Since: gtk+ 2.6

Parameters
About
Documenters

a null-terminated array of strings

Set_License

procedure Set_License
   (About   : not null access Gtk_About_Dialog_Record;
    License : UTF8_String := "")

Sets the license information to be displayed in the secondary license dialog. If License is null, the license button is hidden. Since: gtk+ 2.6

Parameters
About
License

the license information or null

Set_License_Type

procedure Set_License_Type
   (About        : not null access Gtk_About_Dialog_Record;
    License_Type : Gtk_License)

Sets the license of the application showing the About dialog from a list of known licenses. This function overrides the license set using Gtk.About_Dialog.Set_License. Since: gtk+ 3.0

Parameters
About
License_Type

the type of license

Set_Logo

procedure Set_Logo
   (About : not null access Gtk_About_Dialog_Record;
    Logo  : access Gdk.Pixbuf.Gdk_Pixbuf_Record'Class)

Sets the pixbuf to be displayed as logo in the about dialog. If it is null, the default window icon set with Gtk.Window.Set_Default_Icon will be used. Since: gtk+ 2.6

Parameters
About
Logo

a Gdk.Pixbuf.Gdk_Pixbuf, or null

Set_Logo_Icon_Name

procedure Set_Logo_Icon_Name
   (About     : not null access Gtk_About_Dialog_Record;
    Icon_Name : UTF8_String := "")

Sets the pixbuf to be displayed as logo in the about dialog. If it is null, the default window icon set with Gtk.Window.Set_Default_Icon will be used. Since: gtk+ 2.6

Parameters
About
Icon_Name

an icon name, or null

Set_Program_Name

procedure Set_Program_Name
   (About : not null access Gtk_About_Dialog_Record;
    Name  : UTF8_String)

Sets the name to display in the about dialog. If this is not set, it defaults to g_get_application_name. Since: gtk+ 2.12

Parameters
About
Name

the program name

Set_Translator_Credits

procedure Set_Translator_Credits
   (About              : not null access Gtk_About_Dialog_Record;
    Translator_Credits : UTF8_String := "")

Sets the translator credits string which is displayed in the translators tab of the secondary credits dialog. 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 Gtk.About_Dialog.Gtk_About_Dialog will detect if "translator-credits" is untranslated and hide the tab. Since: gtk+ 2.6

Parameters
About
Translator_Credits

the translator credits

Set_Version

procedure Set_Version
   (About   : not null access Gtk_About_Dialog_Record;
    Version : UTF8_String := "")

Sets the version string to display in the about dialog. Since: gtk+ 2.6

Parameters
About
Version

the version string

Set_Website

procedure Set_Website
   (About   : not null access Gtk_About_Dialog_Record;
    Website : UTF8_String := "")

Sets the URL to use for the website link. Since: gtk+ 2.6

Parameters
About
Website

a URL string starting with "http://"

Set_Website_Label

procedure Set_Website_Label
   (About         : not null access Gtk_About_Dialog_Record;
    Website_Label : UTF8_String)

Sets the label to be used for the website link. Since: gtk+ 2.6

Parameters
About
Website_Label

the label used for the website link

Set_Wrap_License

procedure Set_Wrap_License
   (About        : not null access Gtk_About_Dialog_Record;
    Wrap_License : Boolean)

Sets whether the license text in About is automatically wrapped. Since: gtk+ 2.8

Parameters
About
Wrap_License

whether to wrap the license

Signal_Activate_Link

Signal_Activate_Link : constant Glib.Signal_Name := "activate-link";

The signal which gets emitted to activate a URI. Applications may connect to it to override the default behaviour, which is to call gtk_show_uri_on_window.

Callback parameters: -- @param URI the URI that is activated

Translator_Credits_Property

Translator_Credits_Property : constant Glib.Properties.Property_String;

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_Property

Version_Property : constant Glib.Properties.Property_String;

The version of the program.

Website_Label_Property

Website_Label_Property : constant Glib.Properties.Property_String;

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

Website_Property

Website_Property : constant Glib.Properties.Property_String;

The URL for the link to the website of the program. This should be a string starting with "http://.

Wrap_License_Property

Wrap_License_Property : constant Glib.Properties.Property_Boolean;

Whether to wrap the text in the license dialog.