view SimpleDialog.cs @ 40:7c15adc333ea

* Remove "Cancel" button to make the simple dialog button an OK-only dialog
author IBBoard <dev@ibboard.co.uk>
date Wed, 19 Oct 2011 20:29:14 +0100
parents 35b88b848524
children
line wrap: on
line source

//  This file (SimpleDialog.cs) is a part of the IBBoard.GtkSharp project and is copyright 2011 IBBoard
// 
// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU LGPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
using System;
using Gtk;

namespace IBBoard.GtkSharp
{
	/// <summary>
	/// Simple dialog that takes a set of widgets and puts them in the dialog's VBox. The dialog is a convenience
	/// for doing the steps manually for each dialog required.
	/// </summary>
	public partial class SimpleDialog : Dialog
	{
		public SimpleDialog(string title, Window parent, DialogFlags flags, params Bin[] widgets) : base(title, parent, flags)
		{
			this.Build();
			ActionArea.Remove(this.ActionArea.Children[1]);
			foreach (Bin item in widgets)
			{
				VBox.PackEnd(item);
				item.Show();
			}
		}
	}
}