Files
Pilz/Pilz.UI.Gtk/Dialogs/GtkDialogBase.Statics.cs

34 lines
860 B
C#

using Gtk;
namespace Pilz.UI.Gtk.Dialogs;
public partial class GtkDialogBase
{
private static GtkDialogBase CreateDialog<TContent>(TContent content, string title) where TContent : Widget
{
var dialog = new GtkDialogBase
{
Title = title,
};
dialog.ContentArea.Add(content);
content.Show();
return dialog;
}
public static TContent Show<TContent>(TContent content, string title) where TContent : Widget
{
var dialog = CreateDialog(content, title);
dialog.Show();
dialog.Destroy();
return content;
}
public static TContent ShowDialog<TContent>(TContent content, string title) where TContent : Widget
{
var dialog = CreateDialog(content, title);
dialog.Run();
dialog.Destroy();
return content;
}
}