gtk-sharp [00 24 00 00 04 80 00 00 94 00 00 00 06 02 00 00 00 24 00 00 52 53 41 31 00 04 00 00 01 00 01 00 71 EB 6C 55 75 52 9C BF 72 44 F7 A6 EA 05 62 84 F9 EA E0 3B CF F2 CC 13 2C 9C 49 0A B3 09 EA B0 B5 6B CE 44 9D F5 03 D9 C0 A8 1E 52 05 85 CD BE 70 E2 FB 90 43 4B AC 04 FA 62 22 A8 00 98 B7 A1 A7 B3 AF 99 1A 41 23 24 BB 43 25 F6 B8 65 BB 64 EB F6 D1 C2 06 D5 73 2D DF BC 70 A7 38 9E E5 3E 0C 24 6E 32 79 74 1A D0 05 03 E4 98 42 E1 9B F3 7B 19 8B 40 21 26 CB 36 89 C2 EA 64 96 A4 7C B4] 2.12.0.0 Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. This class extends , providing a dialog to show information about a program. The 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 dialogs often contain links and email addresses. supports this by offering global hooks, which are called when the user clicks on a link or email address, see and . 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. The following example creates and shows a from both assembly attributes and stored values. using Gtk; using System.Reflection; [assembly:AssemblyTitleAttribute ("About Dialog Example")] [assembly:AssemblyVersionAttribute ("1.0.0.0")] [assembly:AssemblyDescriptionAttribute ( "An example of the Gtk# AboutDialog using assembly attributes.")] [assembly:AssemblyCopyrightAttribute("Copyright 2007 Brian Nickel")] static public class AboutDialogExample { public static void Main () { Application.Init (); AboutDialog dialog = new AboutDialog (); Assembly asm = Assembly.GetExecutingAssembly (); dialog.Name = (asm.GetCustomAttributes ( typeof (AssemblyTitleAttribute), false) [0] as AssemblyTitleAttribute).Title; dialog.Version = asm.GetName ().Version.ToString (); dialog.Comments = (asm.GetCustomAttributes ( typeof (AssemblyDescriptionAttribute), false) [0] as AssemblyDescriptionAttribute).Description; dialog.Copyright = (asm.GetCustomAttributes ( typeof (AssemblyCopyrightAttribute), false) [0] as AssemblyCopyrightAttribute).Copyright; dialog.License = license; dialog.Authors = authors; dialog.Run (); } private static string [] authors = new string [] { "Brian Nickel <name@domain.ext>", "Rupert T. Monkey <name@domain.ext>" }; private static string license = @"Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."; } Gtk.Dialog Constructor Constructs and initializes a new instance of for a specified native GLib type. A object containing the native GLib type for the new instance. Chain to this constructor if you have manually registered a native value for your subclass. System.Obsolete Constructor Constructs and initializes a new instance of using an existing unmanaged object as its base. A pointing to the raw object to be managed by the new instance. This is not typically used by managed code. It is primarily used for enclosing an existing object, created by unmanaged code, in a managed wrapper. Constructor Constructs and initializes a new instance of for the executing assembly. With no properties set, the window will display only the name of the executing assembly. Property GLib.GType Gets the GLib type of the current instance. A value representing the native GLib type of . The value is used internally by the GLib type management system. Property System.String Gets and sets the license text of the program. A object containing the license text to display with the current instance. 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 by default the text is not wrapped in the text view, thus it must contain the intended linebreaks. GLib.Property("license") Property System.String Gets and sets the name of the program. A object containing the name of the program. The default value is the name of the executing assembly. This may be in the format "MyApplication.exe", "/path/to/MyApplication.exe", or "C:\Path\To\MyApplication.exe" depending on how the assembly was executed and on what platform. GLib.Property("program-name") System.Obsolete("Use ProgramName instead") Property System.String Gets and sets copyright information for the program. A object containing copyright information for the program. The copyright text appears below the text and above the link on the dialog. If unset, not copyright text will appear. GLib.Property("copyright") Property System.String Gets and sets credits for the translation of the program. A object containing credits for the translation of the program. This string should be marked as translatable. Each string may contain email addresses and URLs, which will be displayed as links. See the remarks on for more details. GLib.Property("translator-credits") Property System.String Gets and sets the name of the logo icon to display above the program name in the dialog. A object containing the name of the logo icon to display above the program name in the dialog. If set, this property overrides the property. The name should be equal to the name of the program, without any sort of extension, eg. "monodoc". The dialog will use that name to load an icon by trying the following: The current icon theme, eg. "/usr/share/icons/Tango/48x48/apps/monodoc.png". The pixmap directory, eg. "/usr/share/pixmaps/monodoc.png" The broken image icon. GLib.Property("logo-icon-name") Property System.String Gets and sets the text label to display for the link to . A containing the text label to display for the link to . This value is used to provide a user friendly link to the website, for example "Visit home page." or "AppName website". If not set, the link defaults to the URL specified in the property. GLib.Property("website-label") Property Gdk.Pixbuf Gets and sets a logo to display above the program name in the dialog. A object containing a logo to display above the program name in the dialog. The prefered way to set the logo is through . If this is not set, it defaults to . GLib.Property("logo") Property System.String Gets and sets the URL of the program's website. A containing the URL of the program's website. The value should be a string starting with "http://". If set, the link is displayed at the bottom of the dialog, however if has not been used, the URL will appear as plain text and not be clickable. may be used to provide a plain-text label for the link. GLib.Property("website") Property System.String Gets and sets a comment about the program to appear immediately below the program name in the dialog. A object containing a comment, description, or subtitle for the program. If unset, no comment text is displayed. 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. GLib.Property("comments") Property System.String Get and set the version of the program. A object containing the version of the program. The most appropriate value to put here would be the assembly version, but any string is valid, eg "2.0.0.1", "2.5.3", "2.0 RC1", etc. GLib.Property("version") Method Gtk.AboutDialogActivateLinkFunc Installs a global function to be called whenever the user activates an email link in an about dialog. A delegate to be called when an email link is activated. The delegate that was previously used as the email hook. If no hook is set, email addresses will appear in the dialogs as standard non-clickable text. The following example uses the built in to open emails: Gtk.AboutDialog.SetEmailHook(delegate(Gtk.AboutDialog dialog, string email) { Gnome.Url.Show("mailto:" + email); }); Method Gtk.AboutDialogActivateLinkFunc Installs a global function to be called whenever the user activates a URL link in an about dialog. A to be called when a URL link is activated. The delegate that was the previous used as the URL hook. If no hook is set, the will in the dialogs appear as standard non-clickable text. The following example uses the built in to open links: Gtk.AboutDialog.SetUrlHook(delegate(Gtk.AboutDialog dialog, string link) { Gnome.Url.Show(link); }); Property GLib.Property("documenters") System.String[] Gets and sets the list of people who contributed documentation to the program. A containing the list of people who contributed documentation to the program. Each string may contain email addresses and URLs, which will be displayed as links. See the remarks on for more details. Property GLib.Property("authors") System.String[] Gets and sets the list of people who authored the program. A containing the list of people who authored the program. Each string may contain email addresses and URLs, which will be displayed as links. See the remarks on for more details. Property GLib.Property("artists") System.String[] Gets and sets the list of people who contributed artwork to the program. A containing the list of people who contributed artwork to the program. Each string may contain email addresses and URLs, which will be displayed as links. See the remarks on for more details. Property GLib.Property("wrap-license") System.Boolean Gets and sets whether the text in the is to be automatically wrapped. If , the text is auto-wrapped. Otherwise long lines of text will extend past the edge of the frame and a horizontal scroll bar will appear. By default, this option is set to . Most standard licenses, as will be found in the LICENSE file of a package, are already manually wrapped and auto-wrapping is unneccessary an unwanted. Property GLib.Property("program-name") System.String Program Name property. The name of the program.