Class AboutDialog
- All Implemented Interfaces:
Proxy
,Accessible
,Buildable
,ConstraintTarget
,Native
,Root
,ShortcutManager
GtkAboutDialog
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.
About dialogs often contain links and email addresses. GtkAboutDialog
displays these as clickable links. By default, it calls FileLauncher.launch(org.gnome.gtk.Window, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)
when a user clicks one. The behaviour can be overridden with the
Gtk.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 GtkAboutDialog
as convenient as possible, you can
use the function Gtk.showAboutDialog(org.gnome.gtk.Window, java.lang.String, java.lang.Object...)
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:
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);
Shortcuts and Gestures
GtkAboutDialog
supports the following keyboard shortcuts:
Escape
closes the window.
CSS nodes
GtkAboutDialog
has a single CSS node with the name window
and style
class .aboutdialog
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Functional interface declaration of theActivateLinkCallback
callback.static class
AboutDialog.Builder<B extends AboutDialog.Builder<B>>
Inner class implementing a builder pattern to construct a GObject with properties.Nested classes/interfaces inherited from class org.gnome.gtk.Window
Window.ActivateDefaultCallback, Window.ActivateFocusCallback, Window.CloseRequestCallback, Window.EnableDebuggingCallback, Window.KeysChangedCallback, Window.WindowClass
Nested classes/interfaces inherited from class org.gnome.gtk.Widget
Widget.DestroyCallback, Widget.DirectionChangedCallback, Widget.HideCallback, Widget.KeynavFailedCallback, Widget.MapCallback, Widget.MnemonicActivateCallback, Widget.MoveFocusCallback, Widget.QueryTooltipCallback, Widget.RealizeCallback, Widget.ShowCallback, Widget.StateFlagsChangedCallback, Widget.UnmapCallback, Widget.UnrealizeCallback, Widget.WidgetClass, Widget.WidgetImpl
Nested classes/interfaces inherited from class org.gnome.gobject.InitiallyUnowned
InitiallyUnowned.InitiallyUnownedClass
Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
Nested classes/interfaces inherited from interface org.gnome.gtk.Accessible
Accessible.AccessibleImpl, Accessible.AccessibleInterface
Nested classes/interfaces inherited from interface org.gnome.gtk.Buildable
Buildable.BuildableIface, Buildable.BuildableImpl
Nested classes/interfaces inherited from interface org.gnome.gtk.ConstraintTarget
ConstraintTarget.ConstraintTargetImpl, ConstraintTarget.ConstraintTargetInterface
Nested classes/interfaces inherited from interface org.gnome.gtk.Native
Native.NativeImpl, Native.NativeInterface
Nested classes/interfaces inherited from interface org.gnome.gtk.Root
Root.RootImpl, Root.RootInterface
Nested classes/interfaces inherited from interface org.gnome.gtk.ShortcutManager
ShortcutManager.ShortcutManagerImpl, ShortcutManager.ShortcutManagerInterface
-
Constructor Summary
ConstructorDescriptionCreates a newGtkAboutDialog
.AboutDialog
(MemorySegment address) Create a AboutDialog proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCreditSection
(String sectionName, String[] people) Creates a new section in the "Credits" page.protected AboutDialog
asParent()
Returns this instance as if it were its parent type.static AboutDialog.Builder
<? extends AboutDialog.Builder> builder()
AAboutDialog.Builder
object constructs aAboutDialog
with the specified properties.boolean
emitActivateLink
(String uri) Emits the "activate-link" signal.String[]
Returns the names of the artists which are displayed in the credits page.String[]
Returns the names of the authors which are displayed in the credits page.Returns the comments string.Returns the copyright string.String[]
Returns the name of the documenters which are displayed in the credits page.Returns the license information.Retrieves the license type.getLogo()
Returns the paintable displayed as logo in the about dialog.Returns the icon name displayed as logo in the about dialog.Returns the program name displayed in the about dialog.Returns the system information that is shown in the about dialog.Returns the translator credits string which is displayed in the credits page.static Type
getType()
Get the GType of the AboutDialog classReturns the version string.Returns the website URL.Returns the label used for the website link.boolean
Returns whether the license text in the about dialog is automatically wrapped.Emitted every time a URL is activated.void
setArtists
(String[] artists) Sets the names of the artists to be displayed in the "Credits" page.void
setAuthors
(String[] authors) Sets the names of the authors which are displayed in the "Credits" page of the about dialog.void
setComments
(@Nullable String comments) Sets the comments string to display in the about dialog.void
setCopyright
(@Nullable String copyright) Sets the copyright string to display in the about dialog.void
setDocumenters
(String[] documenters) Sets the names of the documenters which are displayed in the "Credits" page.void
setLicense
(@Nullable String license) Sets the license information to be displayed in the about dialog.void
setLicenseType
(License licenseType) Sets the license of the application showing the about dialog from a list of known licenses.void
Sets the logo in the about dialog.void
setLogoIconName
(@Nullable String iconName) Sets the icon name to be displayed as logo in the about dialog.void
setProgramName
(@Nullable String name) Sets the name to display in the about dialog.void
setSystemInformation
(@Nullable String systemInformation) Sets the system information to be displayed in the about dialog.void
setTranslatorCredits
(@Nullable String translatorCredits) Sets the translator credits string which is displayed in the credits page.void
setVersion
(@Nullable String version) Sets the version string to display in the about dialog.void
setWebsite
(@Nullable String website) Sets the URL to use for the website link.void
setWebsiteLabel
(String websiteLabel) Sets the label to be used for the website link.void
setWrapLicense
(boolean wrapLicense) Sets whether the license text in the about dialog should be automatically wrapped.Methods inherited from class org.gnome.gtk.Window
activateDefault, activateFocus, close, closeRequest, destroy, emitActivateDefault, emitActivateFocus, emitCloseRequest, emitEnableDebugging, emitKeysChanged, enableDebugging, fullscreen, fullscreenOnMonitor, getApplication, getChild, getDecorated, getDefaultIconName, getDefaultSize, getDefaultWidget, getDeletable, getDestroyWithParent, getFocus, getFocusVisible, getGroup, getHandleMenubarAccel, getHideOnClose, getIconName, getMemoryLayout, getMnemonicsVisible, getModal, getResizable, getTitle, getTitlebar, getToplevels, getTransientFor, hasGroup, isActive, isFullscreen, isMaximized, isSuspended, keysChanged, listToplevels, maximize, minimize, onActivateDefault, onActivateFocus, onCloseRequest, onEnableDebugging, onKeysChanged, present, presentWithTime, setApplication, setAutoStartupNotification, setChild, setDecorated, setDefaultIconName, setDefaultSize, setDefaultWidget, setDeletable, setDestroyWithParent, setDisplay, setFocus, setFocusVisible, setHandleMenubarAccel, setHideOnClose, setIconName, setInteractiveDebugging, setMnemonicsVisible, setModal, setResizable, setStartupId, setTitle, setTitlebar, setTransientFor, unfullscreen, unmaximize, unminimize
Methods inherited from class org.gnome.gtk.Widget
actionSetEnabled, activateActionIfExists, activateWidget, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, childFocus, computeBounds, computeExpand, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, cssChanged, directionChanged, disposeTemplate, dragCheckThreshold, emitDestroy, emitDirectionChanged, emitHide, emitKeynavFailed, emitMap, emitMnemonicActivate, emitMoveFocus, emitQueryTooltip, emitRealize, emitShow, emitStateFlagsChanged, emitUnmap, emitUnrealize, errorBell, focus, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getBaseline, getCanFocus, getCanTarget, getChildVisible, getClipboard, getColor, getCssClasses, getCssName, getCursor, getDefaultDirection, getDirection, getDisplay, getFirstChild, getFocusable, getFocusChild, getFocusOnClick, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPreferredSize, getPrevSibling, getPrimaryClipboard, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, moveFocus, observeChildren, observeControllers, onDestroy, onDirectionChanged, onHide, onKeynavFailed, onMap, onMnemonicActivate, onMoveFocus, onQueryTooltip, onRealize, onShow, onStateFlagsChanged, onUnmap, onUnrealize, pick, pick, queryTooltip, queueAllocate, queueDraw, queueResize, realize, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, root, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setDefaultDirection, setDirection, setFocusable, setFocusChild, setFocusOnClick, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setParent, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible, shouldLayout, show, sizeAllocate, sizeAllocate, snapshot, snapshotChild, stateFlagsChanged, systemSettingChanged, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unroot, unsetStateFlags, unsetStateFlags
Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newInstance, newInstance, newv, notify_, notify_, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.gnome.gtk.Accessible
announce, getAccessibleParent, getAccessibleRole, getAtContext, getBounds, getFirstAccessibleChild, getNextAccessibleSibling, getPlatformState, resetProperty, resetRelation, resetState, setAccessibleParent, updateNextAccessibleSibling, updateProperty, updateRelation, updateState
Methods inherited from interface org.gnome.gtk.Buildable
getBuildableId
Methods inherited from interface org.gnome.gtk.Native
getRenderer, getSurface, getSurfaceTransform, realize, unrealize
Methods inherited from interface org.gnome.gtk.Root
getDisplay, getFocus, setFocus
-
Constructor Details
-
AboutDialog
Create a AboutDialog proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
AboutDialog
public AboutDialog()Creates a newGtkAboutDialog
.
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()
doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName()
. This will call the native function pointer of this virtual method in the typeclass of the parent type. -
addCreditSection
-
getArtists
Returns the names of the artists which are displayed in the credits page.- Returns:
- A
NULL
-terminated string array containing the artists
-
getAuthors
Returns the names of the authors which are displayed in the credits page.- Returns:
- A
NULL
-terminated string array containing the authors
-
getComments
-
getCopyright
-
getDocumenters
Returns the name of the documenters which are displayed in the credits page.- Returns:
- A
NULL
-terminated string array containing the documenters
-
getLicense
-
getLicenseType
-
getLogo
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 viasetLogoIconName(java.lang.String)
-
getLogoIconName
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 viasetLogo(org.gnome.gdk.Paintable)
-
getProgramName
Returns the program name displayed in the about dialog.- Returns:
- The program name
-
getSystemInformation
Returns the system information that is shown in the about dialog.- Returns:
- the system information
-
getTranslatorCredits
Returns the translator credits string which is displayed in the credits page.- Returns:
- The translator credits string
-
getVersion
-
getWebsite
-
getWebsiteLabel
Returns the label used for the website link.- Returns:
- The label used for the website link
-
getWrapLicense
public boolean getWrapLicense()Returns whether the license text in the about dialog is automatically wrapped.- Returns:
TRUE
if the license text is wrapped
-
setArtists
Sets the names of the artists to be displayed in the "Credits" page.- Parameters:
artists
- the authors of the artwork of the application
-
setAuthors
Sets the names of the authors which are displayed in the "Credits" page of the about dialog.- Parameters:
authors
- the authors of the application
-
setComments
Sets the comments string to display in the about dialog.This should be a short string of one or two lines.
- Parameters:
comments
- a comments string
-
setCopyright
Sets the copyright string to display in the about dialog.This should be a short string of one or two lines.
- Parameters:
copyright
- the copyright string
-
setDocumenters
Sets the names of the documenters which are displayed in the "Credits" page.- Parameters:
documenters
- the authors of the documentation of the application
-
setLicense
Sets the license information to be displayed in the about dialog.If
license
isNULL
, the license page is hidden.- Parameters:
license
- the license information
-
setLicenseType
Sets the license of the application showing the about dialog from a list of known licenses.This function overrides the license set using
setLicense(java.lang.String)
.- Parameters:
licenseType
- the type of license
-
setLogo
Sets the logo in the about dialog.- Parameters:
logo
- aGdkPaintable
-
setLogoIconName
Sets the icon name to be displayed as logo in the about dialog.- Parameters:
iconName
- an icon name
-
setProgramName
Sets the name to display in the about dialog.If
name
is not set, the string returned byg_get_application_name()
is used.- Parameters:
name
- the program name
-
setSystemInformation
Sets the system information to be displayed in the about dialog.If
system_information
isNULL
, the system information page is hidden.See
Gtk.AboutDialog:system-information
.- Parameters:
systemInformation
- system information
-
setTranslatorCredits
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: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 thatmsgid
, and sinceGtkAboutDialog
will detect if “translator-credits” is untranslated and omit translator credits.- Parameters:
translatorCredits
- the translator credits
-
setVersion
Sets the version string to display in the about dialog.- Parameters:
version
- the version string
-
setWebsite
Sets the URL to use for the website link.- Parameters:
website
- a URL string starting withhttp://
-
setWebsiteLabel
Sets the label to be used for the website link.- Parameters:
websiteLabel
- the label used for the website link
-
setWrapLicense
public void setWrapLicense(boolean wrapLicense) Sets whether the license text in the about dialog should be automatically wrapped.- Parameters:
wrapLicense
- whether to wrap the license
-
onActivateLink
public SignalConnection<AboutDialog.ActivateLinkCallback> onActivateLink(AboutDialog.ActivateLinkCallback handler) Emitted every time a URL is activated.Applications may connect to it to override the default behaviour, which is to call
FileLauncher.launch(org.gnome.gtk.Window, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)
.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitActivateLink
Emits the "activate-link" signal. SeeonActivateLink(org.gnome.gtk.AboutDialog.ActivateLinkCallback)
. -
builder
AAboutDialog.Builder
object constructs aAboutDialog
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withAboutDialog.Builder.build()
.
-