Struct gtk4::AboutDialog

source ·
#[repr(transparent)]
pub struct AboutDialog { /* private fields */ }
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 <edgar@poe.com>. 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 names of the artists which are displayed in the credits page.

Returns

A NULL-terminated string array containing the artists

Returns the names of the authors which are displayed in the credits page.

Returns

A NULL-terminated string array containing the authors

Returns the comments string.

Returns

The comments

Returns the copyright string.

Returns

The copyright string

Returns the name of the documenters which are displayed in the credits page.

Returns

A NULL-terminated string array containing the documenters

Returns the license information.

Returns

The license information

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

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

Returns the program name displayed in the about dialog.

Returns

The program name

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 credits page.

Returns

The translator credits string

Returns the version string.

Returns

The version string

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 names of the artists to be displayed in the “Credits” page.

artists

the authors of the artwork of the application

Sets the names of the authors which are displayed in the “Credits” page of the about 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 names of the documenters which are displayed in the “Credits” page.

documenters

the authors of the documentation of the application

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

If license is NULL, the license page 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, the string returned by g_get_application_name() is used.

name

the program name

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

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

See property::AboutDialog::system-information.

system_information

system information

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:

⚠️ 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 omit translator credits.

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 !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
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§

Updates an array of accessible properties. Read more
Updates an array of accessible relations. Read more
Updates an array of accessible states. Read more
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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Returns true if the object is an instance of (can be cast to) T.
Returns the type of the object.
Returns the ObjectClass of the object. Read more
Returns the class of the object.
Returns the class of the object in the given type T. Read more
Returns the interface T of the object. Read more
Sets the property property_name of the object to value value. Read more
Sets the property property_name of the object to value value. Read more
Sets multiple properties of the object at once. Read more
Sets multiple properties of the object at once. Read more
Gets the property property_name of the object and cast it to the type V. Read more
Gets the property property_name of the object. Read more
Check if the object has a property property_name of the given type_. Read more
Get the type of the property property_name of this object. Read more
Get the ParamSpec of the property property_name of this object.
Return all ParamSpec of the properties of this object.
Freeze all property notifications until the return guard object is dropped. Read more
Set arbitrary data on this object with the given key. Read more
Return previously set arbitrary data of this object with the given key. Read more
Retrieve previously set arbitrary data of this object with the given key. Read more
Set arbitrary data on this object with the given key. Read more
Return previously set arbitrary data of this object with the given key. Read more
Retrieve previously set arbitrary data of this object with the given key. Read more
Block a given signal handler. Read more
Unblock a given signal handler.
Stop emission of the currently emitted signal.
Stop emission of the currently emitted signal by the (possibly detailed) signal name.
Connect to the signal signal_name on this object. Read more
Connect to the signal signal_id on this object. Read more
Connect to the signal signal_name on this object. Read more
Connect to the signal signal_id on this object. Read more
Connect to the signal signal_name on this object. Read more
Connect to the signal signal_id on this object. Read more
Connect a closure to the signal signal_name on this object. Read more
Connect a closure to the signal signal_id on this object. Read more
Limits the lifetime of closure to the lifetime of the object. When the object’s reference count drops to zero, the closure will be invalidated. An invalidated closure will ignore any calls to invoke_with_values, or invoke when using Rust closures. Read more
Emit signal by signal id. Read more
Same as Self::emit but takes Value for the arguments.
Emit signal by its name. Read more
Emit signal by its name. Read more
Emit signal by its name with details. Read more
Emit signal by its name with details. Read more
Emit signal by signal id with details. Read more
Emit signal by signal id with details. Read more
Disconnect a previously connected signal handler.
Connect to the notify signal of the object. Read more
Connect to the notify signal of the object. Read more
Connect to the notify signal of the object. Read more
Notify that the given property has changed its value. Read more
Notify that the given property has changed its value. Read more
Downgrade this object to a weak reference.
Add a callback to be notified when the Object is disposed.
Add a callback to be notified when the Object is disposed. Read more
Bind property source_property on this object to the target_property on the target object. Read more
Returns the strong reference count of this object.
Runs the dispose mechanism of the object. Read more
Ensures that the type has been registered with the type system.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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.