using Gtk; namespace Pilz.UI.Gtk.Dialogs; public partial class GtkDialogBase { private static GtkDialogBase CreateDialog(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 content, string title) where TContent : Widget { var dialog = CreateDialog(content, title); dialog.Show(); dialog.Destroy(); return content; } public static TContent ShowDialog(TContent content, string title) where TContent : Widget { var dialog = CreateDialog(content, title); dialog.Run(); dialog.Destroy(); return content; } }