CtkAboutDialog

CtkAboutDialog — Display information about an application

Functions

CtkWidget * ctk_about_dialog_new ()
const gchar * ctk_about_dialog_get_program_name ()
void ctk_about_dialog_set_program_name ()
const gchar * ctk_about_dialog_get_version ()
void ctk_about_dialog_set_version ()
const gchar * ctk_about_dialog_get_copyright ()
void ctk_about_dialog_set_copyright ()
const gchar * ctk_about_dialog_get_comments ()
void ctk_about_dialog_set_comments ()
const gchar * ctk_about_dialog_get_license ()
void ctk_about_dialog_set_license ()
gboolean ctk_about_dialog_get_wrap_license ()
void ctk_about_dialog_set_wrap_license ()
CtkLicense ctk_about_dialog_get_license_type ()
void ctk_about_dialog_set_license_type ()
const gchar * ctk_about_dialog_get_website ()
void ctk_about_dialog_set_website ()
const gchar * ctk_about_dialog_get_website_label ()
void ctk_about_dialog_set_website_label ()
const gchar * const * ctk_about_dialog_get_authors ()
void ctk_about_dialog_set_authors ()
const gchar * const * ctk_about_dialog_get_artists ()
void ctk_about_dialog_set_artists ()
const gchar * const * ctk_about_dialog_get_documenters ()
void ctk_about_dialog_set_documenters ()
const gchar * ctk_about_dialog_get_translator_credits ()
void ctk_about_dialog_set_translator_credits ()
GdkPixbuf * ctk_about_dialog_get_logo ()
void ctk_about_dialog_set_logo ()
const gchar * ctk_about_dialog_get_logo_icon_name ()
void ctk_about_dialog_set_logo_icon_name ()
void ctk_about_dialog_add_credit_section ()
void ctk_show_about_dialog ()

Properties

GStrv artists Read / Write
GStrv authors Read / Write
char * comments Read / Write
char * copyright Read / Write
GStrv documenters Read / Write
char * license Read / Write
CtkLicense license-type Read / Write
GdkPixbuf * logo Read / Write
char * logo-icon-name Read / Write
char * program-name Read / Write
char * translator-credits Read / Write
char * version Read / Write
char * website Read / Write
char * website-label Read / Write
gboolean wrap-license Read / Write

Signals

gboolean activate-link Run Last

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── CtkWidget
            ╰── CtkContainer
                ╰── CtkBin
                    ╰── CtkWindow
                        ╰── CtkDialog
                            ╰── CtkAboutDialog

Implemented Interfaces

CtkAboutDialog implements AtkImplementorIface and CtkBuildable.

Includes

#include <ctk/ctk.h>

Description

The CtkAboutDialog 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. CtkAboutDialog displays these as clickable links. By default, it calls ctk_show_uri_on_window() 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 "CTK+ team http://github.com/cafe-desktop/ctk".

To make constructing a CtkAboutDialog as convenient as possible, you can use the function ctk_show_about_dialog() which constructs and shows a dialog and keeps it around so that it can be shown again.

Note that CTK+ 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 CtkAboutDialog, as shown in the following example:

1
2
3
4
5
6
GdkPixbuf *example_logo = gdk_pixbuf_new_from_file ("./logo.png", NULL);
ctk_show_about_dialog (NULL,
                       "program-name", "ExampleCode",
                       "logo", example_logo,
                       "title", _("About ExampleCode"),
                       NULL);

It is also possible to show a CtkAboutDialog like any other CtkDialog, e.g. using ctk_dialog_run(). In this case, you might need to know that the “Close” button returns the CTK_RESPONSE_CANCEL response id.

Functions

ctk_about_dialog_new ()

CtkWidget *
ctk_about_dialog_new (void);

Creates a new CtkAboutDialog.

Returns

a newly created CtkAboutDialog

Since: 2.6


ctk_about_dialog_get_program_name ()

const gchar *
ctk_about_dialog_get_program_name (CtkAboutDialog *about);

Returns the program name displayed in the about dialog.

Parameters

about

a CtkAboutDialog

 

Returns

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

Since: 2.12


ctk_about_dialog_set_program_name ()

void
ctk_about_dialog_set_program_name (CtkAboutDialog *about,
                                   const gchar *name);

Sets the name to display in the about dialog. If this is not set, it defaults to g_get_application_name().

Parameters

about

a CtkAboutDialog

 

name

the program name

 

Since: 2.12


ctk_about_dialog_get_version ()

const gchar *
ctk_about_dialog_get_version (CtkAboutDialog *about);

Returns the version string.

Parameters

about

a CtkAboutDialog

 

Returns

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

Since: 2.6


ctk_about_dialog_set_version ()

void
ctk_about_dialog_set_version (CtkAboutDialog *about,
                              const gchar *version);

Sets the version string to display in the about dialog.

Parameters

about

a CtkAboutDialog

 

version

the version string.

[allow-none]

Since: 2.6


ctk_about_dialog_get_copyright ()

const gchar *
ctk_about_dialog_get_copyright (CtkAboutDialog *about);

Returns the copyright string.

Parameters

about

a CtkAboutDialog

 

Returns

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

Since: 2.6


ctk_about_dialog_set_copyright ()

void
ctk_about_dialog_set_copyright (CtkAboutDialog *about,
                                const gchar *copyright);

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

Parameters

about

a CtkAboutDialog

 

copyright

the copyright string.

[allow-none]

Since: 2.6


ctk_about_dialog_get_comments ()

const gchar *
ctk_about_dialog_get_comments (CtkAboutDialog *about);

Returns the comments string.

Parameters

about

a CtkAboutDialog

 

Returns

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

Since: 2.6


ctk_about_dialog_set_comments ()

void
ctk_about_dialog_set_comments (CtkAboutDialog *about,
                               const gchar *comments);

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

Parameters

about

a CtkAboutDialog

 

comments

a comments string.

[allow-none]

Since: 2.6


ctk_about_dialog_get_license ()

const gchar *
ctk_about_dialog_get_license (CtkAboutDialog *about);

Returns the license information.

Parameters

about

a CtkAboutDialog

 

Returns

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

Since: 2.6


ctk_about_dialog_set_license ()

void
ctk_about_dialog_set_license (CtkAboutDialog *about,
                              const gchar *license);

Sets the license information to be displayed in the secondary license dialog. If license is NULL, the license button is hidden.

Parameters

about

a CtkAboutDialog

 

license

the license information or NULL.

[allow-none]

Since: 2.6


ctk_about_dialog_get_wrap_license ()

gboolean
ctk_about_dialog_get_wrap_license (CtkAboutDialog *about);

Returns whether the license text in about is automatically wrapped.

Parameters

about

a CtkAboutDialog

 

Returns

TRUE if the license text is wrapped

Since: 2.8


ctk_about_dialog_set_wrap_license ()

void
ctk_about_dialog_set_wrap_license (CtkAboutDialog *about,
                                   gboolean wrap_license);

Sets whether the license text in about is automatically wrapped.

Parameters

about

a CtkAboutDialog

 

wrap_license

whether to wrap the license

 

Since: 2.8


ctk_about_dialog_get_license_type ()

CtkLicense
ctk_about_dialog_get_license_type (CtkAboutDialog *about);

Retrieves the license set using ctk_about_dialog_set_license_type()

Parameters

about

a CtkAboutDialog

 

Returns

a CtkLicense value

Since: 3.0


ctk_about_dialog_set_license_type ()

void
ctk_about_dialog_set_license_type (CtkAboutDialog *about,
                                   CtkLicense 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 ctk_about_dialog_set_license().

Parameters

about

a CtkAboutDialog

 

license_type

the type of license

 

Since: 3.0


ctk_about_dialog_get_website ()

const gchar *
ctk_about_dialog_get_website (CtkAboutDialog *about);

Returns the website URL.

Parameters

about

a CtkAboutDialog

 

Returns

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

Since: 2.6


ctk_about_dialog_set_website ()

void
ctk_about_dialog_set_website (CtkAboutDialog *about,
                              const gchar *website);

Sets the URL to use for the website link.

Parameters

about

a CtkAboutDialog

 

website

a URL string starting with "http://".

[allow-none]

Since: 2.6


ctk_about_dialog_get_website_label ()

const gchar *
ctk_about_dialog_get_website_label (CtkAboutDialog *about);

Returns the label used for the website link.

Parameters

about

a CtkAboutDialog

 

Returns

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

Since: 2.6


ctk_about_dialog_set_website_label ()

void
ctk_about_dialog_set_website_label (CtkAboutDialog *about,
                                    const gchar *website_label);

Sets the label to be used for the website link.

Parameters

about

a CtkAboutDialog

 

website_label

the label used for the website link

 

Since: 2.6


ctk_about_dialog_get_authors ()

const gchar * const *
ctk_about_dialog_get_authors (CtkAboutDialog *about);

Returns the string which are displayed in the authors tab of the secondary credits dialog.

Parameters

about

a CtkAboutDialog

 

Returns

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

[array zero-terminated=1][transfer none]

Since: 2.6


ctk_about_dialog_set_authors ()

void
ctk_about_dialog_set_authors (CtkAboutDialog *about,
                              const gchar **authors);

Sets the strings which are displayed in the authors tab of the secondary credits dialog.

Parameters

about

a CtkAboutDialog

 

authors

a NULL-terminated array of strings.

[array zero-terminated=1]

Since: 2.6


ctk_about_dialog_get_artists ()

const gchar * const *
ctk_about_dialog_get_artists (CtkAboutDialog *about);

Returns the string which are displayed in the artists tab of the secondary credits dialog.

Parameters

about

a CtkAboutDialog

 

Returns

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

[array zero-terminated=1][transfer none]

Since: 2.6


ctk_about_dialog_set_artists ()

void
ctk_about_dialog_set_artists (CtkAboutDialog *about,
                              const gchar **artists);

Sets the strings which are displayed in the artists tab of the secondary credits dialog.

Parameters

about

a CtkAboutDialog

 

artists

a NULL-terminated array of strings.

[array zero-terminated=1]

Since: 2.6


ctk_about_dialog_get_documenters ()

const gchar * const *
ctk_about_dialog_get_documenters (CtkAboutDialog *about);

Returns the string which are displayed in the documenters tab of the secondary credits dialog.

Parameters

about

a CtkAboutDialog

 

Returns

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

[array zero-terminated=1][transfer none]

Since: 2.6


ctk_about_dialog_set_documenters ()

void
ctk_about_dialog_set_documenters (CtkAboutDialog *about,
                                  const gchar **documenters);

Sets the strings which are displayed in the documenters tab of the secondary credits dialog.

Parameters

about

a CtkAboutDialog

 

documenters

a NULL-terminated array of strings.

[array zero-terminated=1]

Since: 2.6


ctk_about_dialog_get_translator_credits ()

const gchar *
ctk_about_dialog_get_translator_credits
                               (CtkAboutDialog *about);

Returns the translator credits string which is displayed in the translators tab of the secondary credits dialog.

Parameters

about

a CtkAboutDialog

 

Returns

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

Since: 2.6


ctk_about_dialog_set_translator_credits ()

void
ctk_about_dialog_set_translator_credits
                               (CtkAboutDialog *about,
                                const gchar *translator_credits);

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:

1
2
3
CtkWidget *about = ctk_about_dialog_new ();
ctk_about_dialog_set_translator_credits (CTK_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 CtkAboutDialog will detect if “translator-credits” is untranslated and hide the tab.

Parameters

about

a CtkAboutDialog

 

translator_credits

the translator credits.

[allow-none]

Since: 2.6


ctk_about_dialog_get_logo ()

GdkPixbuf *
ctk_about_dialog_get_logo (CtkAboutDialog *about);

Returns the pixbuf displayed as logo in the about dialog.

Parameters

about

a CtkAboutDialog

 

Returns

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.

[transfer none]

Since: 2.6


ctk_about_dialog_set_logo ()

void
ctk_about_dialog_set_logo (CtkAboutDialog *about,
                           GdkPixbuf *logo);

Sets the pixbuf to be displayed as logo in the about dialog. If it is NULL, the default window icon set with ctk_window_set_default_icon() will be used.

Parameters

about

a CtkAboutDialog

 

logo

a GdkPixbuf, or NULL.

[allow-none]

Since: 2.6


ctk_about_dialog_get_logo_icon_name ()

const gchar *
ctk_about_dialog_get_logo_icon_name (CtkAboutDialog *about);

Returns the icon name displayed as logo in the about dialog.

Parameters

about

a CtkAboutDialog

 

Returns

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.

Since: 2.6


ctk_about_dialog_set_logo_icon_name ()

void
ctk_about_dialog_set_logo_icon_name (CtkAboutDialog *about,
                                     const gchar *icon_name);

Sets the pixbuf to be displayed as logo in the about dialog. If it is NULL, the default window icon set with ctk_window_set_default_icon() will be used.

Parameters

about

a CtkAboutDialog

 

icon_name

an icon name, or NULL.

[allow-none]

Since: 2.6


ctk_about_dialog_add_credit_section ()

void
ctk_about_dialog_add_credit_section (CtkAboutDialog *about,
                                     const gchar *section_name,
                                     const gchar **people);

Creates a new section in the Credits page.

Parameters

about

A CtkAboutDialog

 

section_name

The name of the section

 

people

The people who belong to that section.

[array zero-terminated=1]

Since: 3.4


ctk_show_about_dialog ()

void
ctk_show_about_dialog (CtkWindow *parent,
                       const gchar *first_property_name,
                       ...);

This is a convenience function for showing an application’s about box. The constructed dialog is associated with the parent window and reused for future invocations of this function.

Parameters

parent

transient parent, or NULL for none.

[allow-none]

first_property_name

the name of the first property

 

...

value of first property, followed by more properties, NULL-terminated

 

Since: 2.6

Types and Values

struct CtkAboutDialog

struct CtkAboutDialog;

The CtkAboutDialog contains only private fields and should not be directly accessed.


enum CtkLicense

The type of license for an application.

This enumeration can be expanded at later date.

Members

CTK_LICENSE_UNKNOWN

No license specified

 

CTK_LICENSE_CUSTOM

A license text is going to be specified by the developer

 

CTK_LICENSE_GPL_2_0

The GNU General Public License, version 2.0 or later

 

CTK_LICENSE_GPL_3_0

The GNU General Public License, version 3.0 or later

 

CTK_LICENSE_LGPL_2_1

The GNU Lesser General Public License, version 2.1 or later

 

CTK_LICENSE_LGPL_3_0

The GNU Lesser General Public License, version 3.0 or later

 

CTK_LICENSE_BSD

The BSD standard license

 

CTK_LICENSE_MIT_X11

The MIT/X11 standard license

 

CTK_LICENSE_ARTISTIC

The Artistic License, version 2.0

 

CTK_LICENSE_GPL_2_0_ONLY

The GNU General Public License, version 2.0 only. Since 3.12.

 

CTK_LICENSE_GPL_3_0_ONLY

The GNU General Public License, version 3.0 only. Since 3.12.

 

CTK_LICENSE_LGPL_2_1_ONLY

The GNU Lesser General Public License, version 2.1 only. Since 3.12.

 

CTK_LICENSE_LGPL_3_0_ONLY

The GNU Lesser General Public License, version 3.0 only. Since 3.12.

 

CTK_LICENSE_AGPL_3_0

The GNU Affero General Public License, version 3.0 or later. Since: 3.22.

 

CTK_LICENSE_AGPL_3_0_ONLY

The GNU Affero General Public License, version 3.0 only. Since: 3.22.27.

 

CTK_LICENSE_BSD_3

The 3-clause BSD licence. Since: 3.24.20.

 

CTK_LICENSE_APACHE_2_0

The Apache License, version 2.0. Since: 3.24.20.

 

CTK_LICENSE_MPL_2_0

The Mozilla Public License, version 2.0. Since: 3.24.20.

 

Since: 3.0

Property Details

The “artists” property

  “artists”                  GStrv

The people who contributed artwork to the program, as a NULL-terminated array of strings. Each string may contain email addresses and URLs, which will be displayed as links, see the introduction for more details.

Owner: CtkAboutDialog

Flags: Read / Write

Since: 2.6


The “authors” property

  “authors”                  GStrv

The authors of the program, as a NULL-terminated array of strings. Each string may contain email addresses and URLs, which will be displayed as links, see the introduction for more details.

Owner: CtkAboutDialog

Flags: Read / Write

Since: 2.6


The “comments” property

  “comments”                 char *

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.

Owner: CtkAboutDialog

Flags: Read / Write

Default value: NULL

Since: 2.6


The “copyright” property

  “copyright”                char *

Copyright information for the program.

Owner: CtkAboutDialog

Flags: Read / Write

Default value: NULL

Since: 2.6


The “documenters” property

  “documenters”              GStrv

The people documenting the program, as a NULL-terminated array of strings. Each string may contain email addresses and URLs, which will be displayed as links, see the introduction for more details.

Owner: CtkAboutDialog

Flags: Read / Write

Since: 2.6


The “license” property

  “license”                  char *

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 “license-type” property is set to CTK_LICENSE_CUSTOM as a side effect.

Owner: CtkAboutDialog

Flags: Read / Write

Default value: NULL

Since: 2.6


The “license-type” property

  “license-type”             CtkLicense

The license of the program, as a value of the CtkLicense enumeration.

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

If CTK_LICENSE_UNKNOWN is used, the link used will be the same specified in the “website” property.

If CTK_LICENSE_CUSTOM is used, the current contents of the “license” property are used.

For any other CtkLicense value, the contents of the “license” property are also set by this property as a side effect.

Owner: CtkAboutDialog

Flags: Read / Write

Default value: CTK_LICENSE_UNKNOWN

Since: 3.0


The “logo” property

  “logo”                     GdkPixbuf *

A logo for the about box. If it is NULL, the default window icon set with ctk_window_set_default_icon() will be used.

Owner: CtkAboutDialog

Flags: Read / Write

Since: 2.6


The “logo-icon-name” property

  “logo-icon-name”           char *

A named icon to use as the logo for the about box. This property overrides the “logo” property.

Owner: CtkAboutDialog

Flags: Read / Write

Default value: "image-missing"

Since: 2.6


The “program-name” property

  “program-name”             char *

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

Owner: CtkAboutDialog

Flags: Read / Write

Default value: NULL

Since: 2.12


The “translator-credits” property

  “translator-credits”       char *

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.

Owner: CtkAboutDialog

Flags: Read / Write

Default value: NULL

Since: 2.6


The “version” property

  “version”                  char *

The version of the program.

Owner: CtkAboutDialog

Flags: Read / Write

Default value: NULL

Since: 2.6


The “website” property

  “website”                  char *

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

Owner: CtkAboutDialog

Flags: Read / Write

Default value: NULL

Since: 2.6


The “website-label” property

  “website-label”            char *

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

Owner: CtkAboutDialog

Flags: Read / Write

Default value: NULL

Since: 2.6


The “wrap-license” property

  “wrap-license”             gboolean

Whether to wrap the text in the license dialog.

Owner: CtkAboutDialog

Flags: Read / Write

Default value: FALSE

Since: 2.8

Signal Details

The “activate-link” signal

gboolean
user_function (CtkAboutDialog *label,
               char           *uri,
               gpointer        user_data)

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

Parameters

label

The object on which the signal was emitted

 

uri

the URI that is activated

 

user_data

user data set when the signal handler was connected.

 

Returns

TRUE if the link has been activated

Flags: Run Last

Since: 2.24