Struct gtk4::AboutDialog[][src]

pub struct AboutDialog(_);
Expand description

The 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.

An example GtkAboutDialog

About dialogs often contain links and email addresses. AboutDialog displays these as clickable links. By default, it calls show_uri() when a user clicks one. The behaviour can be overridden with the signal::AboutDialog::activate-link signal.

To specify a person with an email address, use a string like Edgar Allan Poe <edgarpoe>. To specify a website with a title, use a string like GTK team https://www.gtk.org.

To make constructing a AboutDialog as convenient as possible, you can use the function 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 AboutDialog, as shown in the following example:

⚠️ The following code is in 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

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

Implements

GtkWindowExt, WidgetExt, glib::ObjectExt, AccessibleExt, BuildableExt, ConstraintTargetExt, NativeExt, RootExt, ShortcutManagerExt, WidgetExtManual, AccessibleExtManual

Implementations

Creates a new AboutDialog.

Returns

a newly created AboutDialog

Creates a new builder-pattern struct instance to construct AboutDialog objects.

This method returns an instance of AboutDialogBuilder which can be used to create AboutDialog objects.

Creates a new section in the “Credits” page.

section_name

The name of the section

people

The people who belong to that section

Returns the string which are displayed in the “Artists” tab of the secondary credits dialog.

Returns

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

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

Returns

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

Returns the comments string.

Returns

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

Returns the copyright string.

Returns

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

Returns the string which are displayed in the “Documenters” tab of the secondary credits dialog.

Returns

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

Returns the license information.

Returns

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

Retrieves the license type.

Returns

a License value

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 set_logo_icon_name(). The paintable is owned by the about dialog.

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 set_logo(). The string is owned by the dialog.

Returns the program name displayed in the about dialog.

Returns

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

Returns the system information that is shown in the about dialog.

Returns

the system information

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

Returns

The translator credits string.

Returns the version string.

Returns

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

Returns the website URL.

Returns

The website URL

Returns the label used for the website link.

Returns

The label used for the website link.

Returns whether the license text in the about dialog is automatically wrapped.

Returns

TRUE if the license text is wrapped

Sets the strings which are displayed in the “Artists” tab of the secondary credits dialog.

artists

the authors of the artwork of the application

Sets the strings which are displayed in the “Authors” tab of the secondary credits dialog.

authors

the authors of the application

Sets the comments string to display in the about dialog.

This should be a short string of one or two lines.

comments

a comments string

Sets the copyright string to display in the about dialog.

This should be a short string of one or two lines.

the copyright string

Sets the strings which are displayed in the “Documenters” tab of the credits dialog.

documenters

the authors of the documentation of the application

Sets the license information to be displayed in the secondary license dialog.

If license is NULL, the license button is hidden.

license

the license information

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().

license_type

the type of license

Sets the logo in the about dialog.

a gdk::Paintable

Sets the icon name to be displayed as logo in the about dialog.

icon_name

an icon name

Sets the name to display in the about dialog.

If name is not set, it defaults to g_get_application_name().

name

the program name

Sets the system information to be displayed in the about dialog.

If system_information is NULL, the system information tab is hidden.

See property::AboutDialog::system-information.

system_information

system information

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:

⚠️ The following code is in 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 AboutDialog will detect if “translator-credits” is untranslated and hide the tab.

translator_credits

the translator credits

Sets the version string to display in the about dialog.

version

the version string

Sets the URL to use for the website link.

website

a URL string starting with http://

Sets the label to be used for the website link.

website_label

the label used for the website link

Sets whether the license text in the about dialog should be automatically wrapped.

wrap_license

whether to wrap the license

Emitted every time a URL is activated.

Applications may connect to it to override the default behaviour, which is to call show_uri().

uri

the URI that is activated

Returns

TRUE if the link has been activated

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Returns the type identifier of Self.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Upcasts an object to a superclass or interface T. Read more

Upcasts an object to a reference of its superclass or interface T. Read more

Tries to downcast to a subclass or interface implementor T. Read more

Tries to downcast to a reference of its subclass or interface implementor T. Read more

Tries to cast to an object of type T. This handles upcasting, downcasting and casting between interface and interface implementors. All checks are performed at runtime, while downcast and upcast will do many checks at compile-time already. Read more

Tries to cast to reference to an object of type T. This handles upcasting, downcasting and casting between interface and interface implementors. All checks are performed at runtime, while downcast and upcast will do many checks at compile-time already. Read more

Casts to T unconditionally. Read more

Casts to &T unconditionally. Read more

Performs the conversion.

Performs the conversion.

Returns true if the object is an instance of (can be cast to) T.

Safety Read more

Safety Read more

Safety Read more

Safety Read more

Safety Read more

Safety Read more

Same as connect but takes a SignalId instead of a signal name.

Same as connect_local but takes a SignalId instead of a signal name.

Same as connect_unsafe but takes a SignalId instead of a signal name.

Emit signal by signal id.

Same as emit but takes Value for the arguments.

Emit signal by its name.

Same as emit_by_name but takes Value for the arguments.

Emit signal with details by signal id.

Same as emit_with_details but takes Value for the arguments.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Returns a SendValue clone of self.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.