Gtk.AboutDialog¶
Example¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Dialog (14), Gtk.Window (119), Gtk.Bin (1), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10)
- Structs:
Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Gtk.Dialog (2), Gtk.Window (5), Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10)
|
Properties¶
- Inherited:
Gtk.Dialog (1), Gtk.Window (33), Gtk.Container (3), Gtk.Widget (39)
Name |
Type |
Flags |
Short Description |
---|---|---|---|
[ |
r/w/en |
List of people who have contributed artwork to the program |
|
[ |
r/w/en |
List of authors of the program |
|
r/w/en |
Comments about the program |
||
r/w/en |
Copyright information for the program |
||
[ |
r/w/en |
List of people documenting the program |
|
r/w/en |
The license of the program |
||
r/w/en |
The license type of the program |
||
r/w/en |
A logo for the about box. If this is not set, it defaults to |
||
r/w/en |
A named icon to use as the logo for the about box. |
||
r/w/en |
The name of the program. If this is not set, it defaults to |
||
r/w/en |
Credits to the translators. This string should be marked as translatable |
||
r/w/en |
The version of the program |
||
r/w/en |
The URL for the link to the website of the program |
||
r/w/en |
The label for the link to the website of the program |
||
r/w/en |
Whether to wrap the license text. |
Style Properties¶
- Inherited:
Signals¶
Name |
Short Description |
---|---|
The signal which gets emitted to activate a URI. |
Fields¶
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Gtk.AboutDialog(*args, **kwargs)¶
- Bases:
- Abstract:
No
- Structure:
The
Gtk.AboutDialog
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 theAbout
option from theHelp
menu. All parts of the dialog are optional.About dialogs often contain links and email addresses.
Gtk.AboutDialog
displays these as clickable links. By default, it callsGtk.show_uri_on_window
() when a user clicks one. The behaviour can be overridden with theGtk.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 http://www.gtk.org”.
To make constructing a
Gtk.AboutDialog
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 aGtk.AboutDialog
, 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.AboutDialog
like any otherGtk.Dialog
, e.g. usingGtk.Dialog.run
(). In this case, you might need to know that the “Close” button returns theGtk.ResponseType.CANCEL
response id.- classmethod new()[source]¶
- Returns:
a newly created
Gtk.AboutDialog
- Return type:
Creates a new
Gtk.AboutDialog
.New in version 2.6.
- add_credit_section(section_name, people)[source]¶
- Parameters:
Creates a new section in the Credits page.
New in version 3.4.
- get_artists()[source]¶
- Returns:
A
None
-terminated string array containing the artists. The array is owned by the about dialog and must not be modified.- Return type:
[
str
]
Returns the string which are displayed in the artists tab of the secondary credits dialog.
New in version 2.6.
- get_authors()[source]¶
- Returns:
A
None
-terminated string array containing the authors. The array is owned by the about dialog and must not be modified.- Return type:
[
str
]
Returns the string which are displayed in the authors tab of the secondary credits dialog.
New in version 2.6.
- get_comments()[source]¶
- Returns:
The comments. The string is owned by the about dialog and must not be modified.
- Return type:
Returns the comments string.
New in version 2.6.
- get_copyright()[source]¶
- Returns:
The copyright string. The string is owned by the about dialog and must not be modified.
- Return type:
Returns the copyright string.
New in version 2.6.
- get_documenters()[source]¶
- Returns:
A
None
-terminated string array containing the documenters. The array is owned by the about dialog and must not be modified.- Return type:
[
str
]
Returns the string which are displayed in the documenters tab of the secondary credits dialog.
New in version 2.6.
- get_license()[source]¶
- Returns:
The license information. The string is owned by the about dialog and must not be modified.
- Return type:
Returns the license information.
New in version 2.6.
- get_license_type()[source]¶
- Returns:
a
Gtk.License
value- Return type:
Retrieves the license set using
Gtk.AboutDialog.set_license_type
()New in version 3.0.
- get_logo()[source]¶
- 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
GObject.Object.ref
() on it.- Return type:
Returns the pixbuf displayed as logo in the about dialog.
New in version 2.6.
- get_logo_icon_name()[source]¶
- 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
GLib.strdup
() on it.- Return type:
Returns the icon name displayed as logo in the about dialog.
New in version 2.6.
- get_program_name()[source]¶
- Returns:
The program name. The string is owned by the about dialog and must not be modified.
- Return type:
Returns the program name displayed in the about dialog.
New in version 2.12.
- get_translator_credits()[source]¶
- Returns:
The translator credits string. The string is owned by the about dialog and must not be modified.
- Return type:
Returns the translator credits string which is displayed in the translators tab of the secondary credits dialog.
New in version 2.6.
- get_version()[source]¶
- Returns:
The version string. The string is owned by the about dialog and must not be modified.
- Return type:
Returns the version string.
New in version 2.6.
- get_website()[source]¶
- Returns:
The website URL. The string is owned by the about dialog and must not be modified.
- Return type:
Returns the website URL.
New in version 2.6.
- get_website_label()[source]¶
- Returns:
The label used for the website link. The string is owned by the about dialog and must not be modified.
- Return type:
Returns the label used for the website link.
New in version 2.6.
- get_wrap_license()[source]¶
-
Returns whether the license text in self is automatically wrapped.
New in version 2.8.
- set_artists(artists)[source]¶
-
Sets the strings which are displayed in the artists tab of the secondary credits dialog.
New in version 2.6.
- set_authors(authors)[source]¶
-
Sets the strings which are displayed in the authors tab of the secondary credits dialog.
New in version 2.6.
- set_comments(comments)[source]¶
-
Sets the comments string to display in the about dialog. This should be a short string of one or two lines.
New in version 2.6.
- set_copyright(copyright)[source]¶
-
Sets the copyright string to display in the about dialog. This should be a short string of one or two lines.
New in version 2.6.
- set_documenters(documenters)[source]¶
-
Sets the strings which are displayed in the documenters tab of the secondary credits dialog.
New in version 2.6.
- set_license(license)[source]¶
-
Sets the license information to be displayed in the secondary license dialog. If license is
None
, the license button is hidden.New in version 2.6.
- set_license_type(license_type)[source]¶
- Parameters:
license_type (
Gtk.License
) – the type of license
Sets the license of the application showing the self dialog from a list of known licenses.
This function overrides the license set using
Gtk.AboutDialog.set_license
().New in version 3.0.
- set_logo(logo)[source]¶
- Parameters:
logo (
GdkPixbuf.Pixbuf
orNone
) – aGdkPixbuf.Pixbuf
, orNone
Sets the pixbuf to be displayed as logo in the about dialog. If it is
None
, the default window icon set withGtk.Window.set_default_icon
() will be used.New in version 2.6.
- set_logo_icon_name(icon_name)[source]¶
-
Sets the pixbuf to be displayed as logo in the about dialog. If it is
None
, the default window icon set withGtk.Window.set_default_icon
() will be used.New in version 2.6.
- set_program_name(name)[source]¶
- Parameters:
name (
str
) – the program name
Sets the name to display in the about dialog. If this is not set, it defaults to
GLib.get_application_name
().New in version 2.12.
- set_translator_credits(translator_credits)[source]¶
-
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.AboutDialog
will detect if “translator-credits” is untranslated and hide the tab.New in version 2.6.
- set_version(version)[source]¶
-
Sets the version string to display in the about dialog.
New in version 2.6.
- set_website_label(website_label)[source]¶
- Parameters:
website_label (
str
) – the label used for the website link
Sets the label to be used for the website link.
New in version 2.6.
Signal Details¶
- Gtk.AboutDialog.signals.activate_link(about_dialog, uri)¶
- Signal Name:
activate-link
- Flags:
- Parameters:
about_dialog (
Gtk.AboutDialog
) – The object which received the signaluri (
str
) – the URI that is activated
- Returns:
True
if the link has been activated- Return type:
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
().New in version 2.24.
Property Details¶
- Gtk.AboutDialog.props.artists¶
- Name:
artists
- Type:
[
str
]- Default Value:
[]
- Flags:
The people who contributed artwork to the program, as a
None
-terminated array of strings. Each string may contain email addresses and URLs, which will be displayed as links, see the introduction for more details.New in version 2.6.
- Gtk.AboutDialog.props.authors¶
- Name:
authors
- Type:
[
str
]- Default Value:
[]
- Flags:
The authors of the program, as a
None
-terminated array of strings. Each string may contain email addresses and URLs, which will be displayed as links, see the introduction for more details.New in version 2.6.
- Gtk.AboutDialog.props.comments¶
- Name:
comments
- Type:
- Default Value:
- Flags:
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.
New in version 2.6.
- Gtk.AboutDialog.props.copyright¶
- Name:
copyright
- Type:
- Default Value:
- Flags:
Copyright information for the program.
New in version 2.6.
- Gtk.AboutDialog.props.documenters¶
- Name:
documenters
- Type:
[
str
]- Default Value:
[]
- Flags:
The people documenting the program, as a
None
-terminated array of strings. Each string may contain email addresses and URLs, which will be displayed as links, see the introduction for more details.New in version 2.6.
- Gtk.AboutDialog.props.license¶
- Name:
license
- Type:
- Default Value:
- Flags:
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-None
value, theGtk.AboutDialog
:license-type
property is set toGtk.License.CUSTOM
as a side effect.New in version 2.6.
- Gtk.AboutDialog.props.license_type¶
- Name:
license-type
- Type:
- Default Value:
- Flags:
The license of the program, as a value of the
Gtk.License
enumeration.The
Gtk.AboutDialog
will automatically fill out a standard disclaimer and link the user to the appropriate online resource for the license text.If
Gtk.License.UNKNOWN
is used, the link used will be the same specified in theGtk.AboutDialog
:website
property.If
Gtk.License.CUSTOM
is used, the current contents of theGtk.AboutDialog
:license
property are used.For any other
Gtk.License
value, the contents of theGtk.AboutDialog
:license
property are also set by this property as a side effect.New in version 3.0.
- Gtk.AboutDialog.props.logo¶
- Name:
logo
- Type:
- Default Value:
- Flags:
A logo for the about box. If it is
None
, the default window icon set withGtk.Window.set_default_icon
() will be used.New in version 2.6.
- Gtk.AboutDialog.props.logo_icon_name¶
- Name:
logo-icon-name
- Type:
- Default Value:
'image-missing'
- Flags:
A named icon to use as the logo for the about box. This property overrides the
Gtk.AboutDialog
:logo
property.New in version 2.6.
- Gtk.AboutDialog.props.program_name¶
- Name:
program-name
- Type:
- Default Value:
- Flags:
The name of the program. If this is not set, it defaults to
GLib.get_application_name
().New in version 2.12.
- Gtk.AboutDialog.props.translator_credits¶
- Name:
translator-credits
- Type:
- Default Value:
- Flags:
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.
New in version 2.6.
- Gtk.AboutDialog.props.version¶
- Name:
version
- Type:
- Default Value:
- Flags:
The version of the program.
New in version 2.6.
- Gtk.AboutDialog.props.website¶
- Name:
website
- Type:
- Default Value:
- Flags:
The URL for the link to the website of the program. This should be a string starting with “http://.
New in version 2.6.
- Gtk.AboutDialog.props.website_label¶
- Name:
website-label
- Type:
- Default Value:
- Flags:
The label for the link to the website of the program.
New in version 2.6.