Class AboutDialog
- All Implemented Interfaces:
Accessible,Buildable,ConstraintTarget,Native,Root,ShortcutManager,Proxy
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 an about dialog 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 an about dialog,
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:
Escapecloses the window.
CSS nodes
GtkAboutDialog has a single CSS node with the name window and style
class .aboutdialog.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceFunctional interface declaration of theActivateLinkCallbackcallback.static classAboutDialog.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.WindowClassNested 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.Widget$Impl, Widget.WidgetClassNested classes/interfaces inherited from class org.gnome.gobject.InitiallyUnowned
InitiallyUnowned.InitiallyUnownedClassNested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClassNested classes/interfaces inherited from interface org.gnome.gtk.Accessible
Accessible.Accessible$Impl, Accessible.AccessibleInterfaceNested classes/interfaces inherited from interface org.gnome.gtk.Buildable
Buildable.Buildable$Impl, Buildable.BuildableIfaceNested classes/interfaces inherited from interface org.gnome.gtk.ConstraintTarget
ConstraintTarget.ConstraintTarget$Impl, ConstraintTarget.ConstraintTargetInterfaceNested classes/interfaces inherited from interface org.gnome.gtk.Native
Native.Native$Impl, Native.NativeInterfaceNested classes/interfaces inherited from interface org.gnome.gtk.Root
Root.Root$Impl, Root.RootInterfaceNested classes/interfaces inherited from interface org.gnome.gtk.ShortcutManager
ShortcutManager.ShortcutManager$Impl, ShortcutManager.ShortcutManagerInterface -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new AboutDialog.AboutDialog(MemorySegment address) Create a AboutDialog proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCreditSection(String sectionName, @Nullable String @Nullable [] people) Creates a new section in the "Credits" page.protected AboutDialogasParent()Returns this instance as if it were its parent type.static AboutDialog.Builder<? extends AboutDialog.Builder> builder()AAboutDialog.Builderobject constructs aAboutDialogwith the specified properties.booleanemitActivateLink(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.@Nullable StringReturns the comments string.@Nullable StringReturns the copyright string.String[]Returns the name of the documenters which are displayed in the credits page.@Nullable StringReturns the license information.Retrieves the license type.@Nullable PaintablegetLogo()Returns the paintable displayed as logo in the about dialog.@Nullable StringReturns the icon name displayed as logo in the about dialog.@Nullable StringReturns the program name displayed in the about dialog.@Nullable StringReturns the system information that is shown in the about dialog.@Nullable StringReturns the translator credits string which is displayed in the credits page.static @Nullable TypegetType()Get the GType of the AboutDialog class@Nullable StringReturns the version string.@Nullable StringReturns the website URL.@Nullable StringReturns the label used for the website link.booleanReturns whether the license text in the about dialog is automatically wrapped.Emitted every time a URL is activated.voidsetArtists(@Nullable String @Nullable [] artists) Sets the names of the artists to be displayed in the "Credits" page.voidsetAuthors(@Nullable String @Nullable [] authors) Sets the names of the authors which are displayed in the "Credits" page of the about dialog.voidsetComments(@Nullable String comments) Sets the comments string to display in the about dialog.voidsetCopyright(@Nullable String copyright) Sets the copyright string to display in the about dialog.voidsetDocumenters(@Nullable String @Nullable [] documenters) Sets the names of the documenters which are displayed in the "Credits" page.voidsetLicense(@Nullable String license) Sets the license information to be displayed in the about dialog.voidsetLicenseType(License licenseType) Sets the license of the application showing the about dialog from a list of known licenses.voidSets the logo in the about dialog.voidsetLogoIconName(@Nullable String iconName) Sets the icon name to be displayed as logo in the about dialog.voidsetProgramName(@Nullable String name) Sets the name to display in the about dialog.voidsetSystemInformation(@Nullable String systemInformation) Sets the system information to be displayed in the about dialog.voidsetTranslatorCredits(@Nullable String translatorCredits) Sets the translator credits string which is displayed in the credits page.voidsetVersion(@Nullable String version) Sets the version string to display in the about dialog.voidsetWebsite(@Nullable String website) Sets the URL to use for the website link.voidsetWebsiteLabel(String websiteLabel) Sets the label to be used for the website link.voidsetWrapLicense(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, getGravity, 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, setGravity, setHandleMenubarAccel, setHideOnClose, setIconName, setInteractiveDebugging, setMnemonicsVisible, setModal, setResizable, setStartupId, setTitle, setTitlebar, setTransientFor, unfullscreen, unmaximize, unminimizeMethods 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, getLimitEvents, 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, setLimitEvents, 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, unsetStateFlagsMethods 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, 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, withPropertiesMethods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gnome.gtk.Accessible
announce, getAccessibleParent, getAccessibleRole, getAtContext, getBounds, getFirstAccessibleChild, getNextAccessibleSibling, getPlatformState, resetProperty, resetRelation, resetState, setAccessibleParent, updateNextAccessibleSibling, updatePlatformState, updateProperty, updateRelation, updateStateMethods inherited from interface org.gnome.gtk.Buildable
getBuildableIdMethods inherited from interface org.gnome.gtk.Native
getRenderer, getSurface, getSurfaceTransform, realize, unrealizeMethods 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 new AboutDialog.
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuperkeyword, 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
Returns the license information.- Returns:
- The license information
-
getLicenseType
-
getLogo
Returns the paintable displayed as logo in the about dialog.- Returns:
- the paintable displayed as
logo or
NULLif 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
NULLif 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:
TRUEif 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
licenseisNULL, 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
nameis 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_informationisNULL, 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 sinceGtkAboutDialogwill 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.Builderobject constructs aAboutDialogwith the specified properties. Use the variousset...()methods to set properties, and finish construction withAboutDialog.Builder.build().- Returns:
- the builder object
-