dotnet new console
dotnet add package GtkSharp
dotnet run
using Gtk; class Program { public static void Main() { Application.Init(); new FirstWindow(); Application.Run(); } public static void Quit() { Application.Quit(); } }
using Gtk; class FirstWindow : Window { public FirstWindow() : base("Test") { SetDefaultSize(600, 350); SetPosition(WindowPosition.Center); DeleteEvent += delegate { Program.Quit(); }; VBox vBox = new VBox(); Add(vBox); HBox hBox = new HBox(); vBox.PackStart(hBox, true, true, 5); Calendar calendar = new Calendar() { Date = DateTime.Now }; calendar.DaySelectedDoubleClick += (object? sender, EventArgs args) => { Console.WriteLine(calendar.Date); }; hBox.PackStart(calendar, true, true, 5); ShowAll(); } }
© accounting.org.ua - 2024