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); HPaned hPaned = new HPaned(); hBox.PackStart(hPaned, true, true, 5); //Лівий блок панелі { VBox vBoxPaned = new VBox() ; hPaned.Pack1(vBoxPaned, true, false); HBox hBoxPaned = new HBox(); vBoxPaned.PackStart(hBoxPaned, false, false, 5); hBoxPaned.PackStart(new Label("Text 1"), false, false, 5); } //Правий блок панелі (фіксована ширина 200) { VBox vBoxPaned = new VBox() { WidthRequest = 200 }; hPaned.Pack2(vBoxPaned, false, false); HBox hBoxPaned = new HBox(); vBoxPaned.PackStart(hBoxPaned, false, false, 5); hBoxPaned.PackStart(new Label("Text 2"), false, false, 5); } ShowAll(); } }
© accounting.org.ua - 2024