more work on gtk & code cleanup

This commit is contained in:
2025-06-16 15:30:56 +02:00
parent 6f7bb5d92c
commit a49a3b2beb
69 changed files with 374 additions and 268 deletions

View File

@@ -0,0 +1,33 @@
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;
}
}