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, false, false, 10); hBox.PackStart(new SpinButton(0, 100, 1) { Orientation = Orientation.Vertical }, false, false, 10); } { HBox hBox = new HBox(); vBox.PackStart(hBox, false, false, 10); hBox.PackStart(new SpinButton(0, 100, 1) { Orientation = Orientation.Horizontal }, false, false, 10); } ShowAll(); } }
© accounting.org.ua - 2024