using Gtk; using System; class SharpApp : Window { Label label; public SharpApp() : base("Початкове вікно") { SetDefaultSize(300, 120); SetPosition(WindowPosition.Center); DeleteEvent += delegate { Application.Quit(); }; label = new Label("Поточний шрифт"); Button button = new Button("Вибрати шрифт"); button.Clicked += OnClicked; Fixed fix = new Fixed(); fix.Put(button, 100, 30); fix.Put(label, 10, 90); Add(fix); ShowAll(); } void OnClicked(object sender, EventArgs args) { FontSelectionDialog fdia = new FontSelectionDialog("Вибір шрифта"); fdia.Response += delegate (object o, ResponseArgs resp) { if (resp.ResponseId == ResponseType.Ok) { Pango.FontDescription fontdesc = Pango.FontDescription.FromString(fdia.FontName); label.ModifyFont(fontdesc); } }; fdia.Run(); fdia.Destroy(); } public static void Main() { Application.Init(); new SharpApp(); Application.Run(); } }