В програмі Visual Studio Code створюємо новий проектdotnet new console
Додаємо до проекту пакет GirCore.Gtkdotnet add package GirCore.Gtk-4.0
Запуск програмиdotnet run
Program.cs
using Gtk; class Program { static void Main() { var app = Application.New("ua.org.accounting.test", Gio.ApplicationFlags.FlagsNone); app.OnActivate += (sender, args) => { FirstWindow firstWindow = new(app); firstWindow.Show(); }; app.RunWithSynchronizationContext(null); } }
using Gtk; using static Gtk.Orientation; class FirstWindow : Window { public FirstWindow(Application app) : base() { Application = app; Title = "Video"; SetDefaultSize(500, 300); Video video = Video.NewForFilename("/home/user_name/1.mp4"); video.Autoplay = true; Child = video; } }
Visual Studio Code
Віджети Gtk 4
NuGet пакет GirCore.Gtk-4.0
© accounting.org.ua - 2025