Gtk.AboutDialog Class
This class extends k.Dialog, providing a dialog to show information about a program.

See Also: AboutDialog Members

Syntax

public class AboutDialog : Dialog

Remarks

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 the About option from the Help menu. All parts of the dialog are optional.

About dialogs often contain links and email addresses. Gtk.AboutDialog supports this by offering global hooks, which are called when the user clicks on a link or email address, see AboutDialog.SetEmailHook() and AboutDialog.SetUrlHook(). 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 Gtk.AboutDialog from both assembly attributes and stored values.

C# Example

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.";
}

Requirements

Namespace: Gtk
Assembly: gtk-sharp (in gtk-sharp.dll)
Assembly Versions: 2.12.0.0
Since: Gtk# 2.6