AboutDialog

Description The GtkAboutDialog 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 the About option from the Help menu. All parts of the dialog are optional. About dialog often contain links and email addresses. GtkAboutDialog supports this by offering global hooks, which are called when the user clicks on a link or email address, see gtk_about_dialog_set_email_hook() and gtk_about_dialog_set_url_hook(). Email addresses in the authors, documenters and artists properties are recognized by looking for <user@host>, URLs are recognized by looking for http://url, with url extending to the next space, tab or line break. Since 2.18 GtkAboutDialog provides default website and email hooks that use gtk_show_uri(). If you want provide your own hooks overriding the default ones, it is important to do so before setting the website and email URL properties, like this: To disable the default hooks, you can pass NULL as the hook func. Then, the GtkAboutDialog widget will not display the website or the email addresses as clickable. To make constructing a GtkAboutDialog 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 a GtkAboutDialog, as shown in the following example: Note that prior to GTK+ 2.12, the "program-name" property was called "name". This was changed to avoid the conflict with the "name" property.

class AboutDialog : Dialog {}

Constructors

this
this(GtkAboutDialog* gtkAboutDialog)

Sets our main struct and passes it to the parent class

this
this()

Creates a new GtkAboutDialog. Since 2.6

Members

Functions

addOnActivateLink
void addOnActivateLink(bool delegate(string, AboutDialog) dlg, ConnectFlags connectFlags)

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(). TRUE if the link has been activated Since 2.24 See Also GTK_STOCK_ABOUT

getAboutDialogStruct
GtkAboutDialog* getAboutDialogStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getArtists
string[] getArtists()

Returns the string which are displayed in the artists tab of the secondary credits dialog. Since 2.6

getAuthors
string[] getAuthors()

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

getComments
string getComments()

Returns the comments string. Since 2.6

getCopyright
string getCopyright()

Returns the copyright string. Since 2.6

getDocumenters
string[] getDocumenters()

Returns the string which are displayed in the documenters tab of the secondary credits dialog. Since 2.6

getLicense
string getLicense()

Returns the license information. Since 2.6

getLogo
Pixbuf getLogo()

Returns the pixbuf displayed as logo in the about dialog. Since 2.6

getLogoIconName
string getLogoIconName()

Returns the icon name displayed as logo in the about dialog. Since 2.6

getName
string getName()

Warning gtk_about_dialog_get_name has been deprecated since version 2.12 and should not be used in newly-written code. Use gtk_about_dialog_get_program_name() instead. Returns the program name displayed in the about dialog. Since 2.6

getProgramName
string getProgramName()

Returns the program name displayed in the about dialog. Since 2.12

getStruct
void* getStruct()

the main Gtk struct as a void*

getTranslatorCredits
string getTranslatorCredits()

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

getVersion
string getVersion()

Returns the version string. Since 2.6

getWebsite
string getWebsite()

Returns the website URL. Since 2.6

getWebsiteLabel
string getWebsiteLabel()

Returns the label used for the website link. Since 2.6

getWrapLicense
int getWrapLicense()

Returns whether the license text in about is automatically wrapped. Since 2.8

setArtists
void setArtists(string[] artists)

Sets the strings which are displayed in the artists tab of the secondary credits dialog. Since 2.6

setAuthors
void setAuthors(string[] authors)

Sets the strings which are displayed in the authors tab of the secondary credits dialog. Since 2.6

setComments
void setComments(string comments)

Sets the comments string to display in the about dialog. This should be a short string of one or two lines. Since 2.6

setCopyright
void setCopyright(string copyright)

Sets the copyright string to display in the about dialog. This should be a short string of one or two lines. Since 2.6

setDocumenters
void setDocumenters(string[] documenters)

Sets the strings which are displayed in the documenters tab of the secondary credits dialog. Since 2.6

setLicense
void setLicense(string license)

Sets the license information to be displayed in the secondary license dialog. If license is NULL, the license button is hidden. Since 2.6

setLogo
void setLogo(Pixbuf logo)

Sets the pixbuf to be displayed as logo in the about dialog. If it is NULL, the default window icon set with gtk_window_set_default_icon() will be used. Since 2.6

setLogoIconName
void setLogoIconName(string iconName)

Sets the pixbuf to be displayed as logo in the about dialog. If it is NULL, the default window icon set with gtk_window_set_default_icon() will be used. Since 2.6

setName
void setName(string name)

Warning gtk_about_dialog_set_name has been deprecated since version 2.12 and should not be used in newly-written code. Use gtk_about_dialog_set_program_name() instead. Sets the name to display in the about dialog. If this is not set, it defaults to g_get_application_name(). Since 2.6

setProgramName
void setProgramName(string name)

Sets the name to display in the about dialog. If this is not set, it defaults to g_get_application_name(). Since 2.12

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
setTranslatorCredits
void setTranslatorCredits(string translatorCredits)

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 Since 2.6

setVersion
void setVersion(string versio)

Sets the version string to display in the about dialog. Since 2.6

setWebsite
void setWebsite(string website)

Sets the URL to use for the website link. Note that that the hook functions need to be set up before calling this function. Since 2.6

setWebsiteLabel
void setWebsiteLabel(string websiteLabel)

Sets the label to be used for the website link. It defaults to the website URL. Since 2.6

setWrapLicense
void setWrapLicense(int wrapLicense)

Sets whether the license text in about is automatically wrapped. Since 2.8

Static functions

callBackActivateLink
gboolean callBackActivateLink(GtkAboutDialog* labelStruct, gchar* uri, AboutDialog _aboutDialog)
Undocumented in source. Be warned that the author may not have intended to support it.
setEmailHook
GtkAboutDialogActivateLinkFunc setEmailHook(GtkAboutDialogActivateLinkFunc func, void* data, GDestroyNotify destroy)

Warning gtk_about_dialog_set_email_hook has been deprecated since version 2.24 and should not be used in newly-written code. Use the "activate-link" signal Installs a global function to be called whenever the user activates an email link in an about dialog. Since 2.18 there exists a default function which uses gtk_show_uri(). To deactivate it, you can pass NULL for func. Since 2.6

setUrlHook
GtkAboutDialogActivateLinkFunc setUrlHook(GtkAboutDialogActivateLinkFunc func, void* data, GDestroyNotify destroy)

Warning gtk_about_dialog_set_url_hook has been deprecated since version 2.24 and should not be used in newly-written code. Use the "activate-link" signal Installs a global function to be called whenever the user activates a URL link in an about dialog. Since 2.18 there exists a default function which uses gtk_show_uri(). To deactivate it, you can pass NULL for func. Since 2.6

Variables

connectedSignals
int[string] connectedSignals;
gtkAboutDialog
GtkAboutDialog* gtkAboutDialog;

the main Gtk struct

onActivateLinkListeners
bool delegate(string, AboutDialog)[] onActivateLinkListeners;
Undocumented in source.

Inherited Members

From Dialog

gtkDialog
GtkDialog* gtkDialog;

the main Gtk struct

getDialogStruct
GtkDialog* getDialogStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getStruct
void* getStruct()

the main Gtk struct as a void*

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
addButton
Widget addButton(StockID stockID, int responseId)
addButtons
void addButtons(string[] buttonsText, ResponseType[] responses)
addButtons
void addButtons(StockID[] stockIDs, ResponseType[] responses)
getActionArea
HButtonBox getActionArea()

Returns the action area of dialog. Since 2.14

getContentArea
VBox getContentArea()

Returns the content area of dialog. Since 2.14

connectedSignals
int[string] connectedSignals;
onCloseListeners
void delegate(Dialog)[] onCloseListeners;
Undocumented in source.
addOnClose
void addOnClose(void delegate(Dialog) dlg, ConnectFlags connectFlags)

The ::close signal is a keybinding signal which gets emitted when the user uses a keybinding to close the dialog. The default binding for this signal is the Escape key.

callBackClose
void callBackClose(GtkDialog* arg0Struct, Dialog _dialog)
Undocumented in source. Be warned that the author may not have intended to support it.
onResponseListeners
void delegate(gint, Dialog)[] onResponseListeners;
Undocumented in source.
addOnResponse
void addOnResponse(void delegate(gint, Dialog) dlg, ConnectFlags connectFlags)

Emitted when an action widget is clicked, the dialog receives a delete event, or the application programmer calls gtk_dialog_response(). On a delete event, the response ID is GTK_RESPONSE_DELETE_EVENT. Otherwise, it depends on which action widget was clicked. See Also GtkVBox Pack widgets vertically. GtkWindow Alter the properties of your dialog box. GtkButton Add them to the action_area to get a response from the user.

callBackResponse
void callBackResponse(GtkDialog* dialogStruct, gint responseId, Dialog _dialog)
Undocumented in source. Be warned that the author may not have intended to support it.
run
int run()

Blocks in a recursive main loop until the dialog either emits the "response" signal, or is destroyed. If the dialog is destroyed during the call to gtk_dialog_run(), gtk_dialog_run() returns GTK_RESPONSE_NONE. Otherwise, it returns the response ID from the ::response signal emission. Before entering the recursive main loop, gtk_dialog_run() calls gtk_widget_show() on the dialog for you. Note that you still need to show any children of the dialog yourself. During gtk_dialog_run(), the default behavior of "delete-event" is disabled; if the dialog receives ::delete_event, it will not be destroyed as windows usually are, and gtk_dialog_run() will return GTK_RESPONSE_DELETE_EVENT. Also, during gtk_dialog_run() the dialog will be modal. You can force gtk_dialog_run() to return at any time by calling gtk_dialog_response() to emit the ::response signal. Destroying the dialog during gtk_dialog_run() is a very bad idea, because your post-run code won't know whether the dialog was destroyed or not. After gtk_dialog_run() returns, you are responsible for hiding or destroying the dialog if you wish to do so.

response
void response(int responseId)

Emits the "response" signal with the given response ID. Used to indicate that the user has responded to the dialog in some way; typically either you or gtk_dialog_run() will be monitoring the ::response signal and take appropriate action.

addButton
Widget addButton(string buttonText, int responseId)

Adds a button with the given text (or a stock button, if button_text is a stock ID) and sets things up so that clicking the button will emit the "response" signal with the given response_id. The button is appended to the end of the dialog's action area. The button widget is returned, but usually you don't need it.

addActionWidget
void addActionWidget(Widget child, int responseId)

Adds an activatable widget to the action area of a GtkDialog, connecting a signal handler that will emit the "response" signal on the dialog when the widget is activated. The widget is appended to the end of the dialog's action area. If you want to add a non-activatable widget, simply pack it into the action_area field of the GtkDialog struct.

getHasSeparator
int getHasSeparator()

Warning gtk_dialog_get_has_separator has been deprecated since version 2.22 and should not be used in newly-written code. This function will be removed in GTK+ 3 Accessor for whether the dialog has a separator.

setDefaultResponse
void setDefaultResponse(int responseId)

Sets the last widget in the dialog's action area with the given response_id as the default widget for the dialog. Pressing "Enter" normally activates the default widget.

setHasSeparator
void setHasSeparator(int setting)

Warning gtk_dialog_set_has_separator has been deprecated since version 2.22 and should not be used in newly-written code. This function will be removed in GTK+ 3 Sets whether the dialog has a separator above the buttons.

setResponseSensitive
void setResponseSensitive(int responseId, int setting)

Calls gtk_widget_set_sensitive (widget, setting) for each widget in the dialog's action area with the given response_id. A convenient way to sensitize/desensitize dialog buttons.

getResponseForWidget
int getResponseForWidget(Widget widget)

Gets the response id of a widget in the action area of a dialog. Since 2.8

getWidgetForResponse
Widget getWidgetForResponse(int responseId)

Gets the widget button that uses the given response ID in the action area of a dialog. Since 2.20

alternativeDialogButtonOrder
int alternativeDialogButtonOrder(Screen screen)

Returns TRUE if dialogs are expected to use an alternative button order on the screen screen. See gtk_dialog_set_alternative_button_order() for more details about alternative button order. If you need to use this function, you should probably connect to the ::notify:gtk-alternative-button-order signal on the GtkSettings object associated to screen, in order to be notified if the button order setting changes. Since 2.6

setAlternativeButtonOrderFromArray
void setAlternativeButtonOrderFromArray(int[] newOrder)

Sets an alternative button order. If the "gtk-alternative-button-order" setting is set to TRUE, the dialog buttons are reordered according to the order of the response ids in new_order. See gtk_dialog_set_alternative_button_order() for more information. This function is for use by language bindings. Since 2.6

Meta