using Gtk; public class SharpApp : Window { public SharpApp() : base ("Tree") { SetDefaultSize(150, 150); SetPosition(WindowPosition.Center); DeleteEvent += delegate {Application.Quit();}; TreeView tree = new TreeView(); TreeViewColumn l = new TreeViewColumn(); // Створено l - стовпчик TreeView l.Title = "Перебір"; // з назвою «Перебір»*. CellRendererText cell = new CellRendererText(); // Використання текстових даних l.PackStart(cell, true); // для заповнення l l.AddAttribute(cell, "text", 0); TreeStore treestore = new TreeStore((string), typeof(string));// Сховище даних TreeIter i, j; // Забезпечують доступ до даних сховища i = treestore.AppendValues("0"); // Дадавання даних j = treestore.AppendValues(i, "00"); treestore.AppendValues(j, "000"); treestore.AppendValues(j, "001"); j = treestore.AppendValues(i, "01"); treestore.AppendValues(j, "010"); treestore.AppendValues(j, "011"); i = treestore.AppendValues("1"); j = treestore.AppendValues(i, "10"); treestore.AppendValues(j, "100"); treestore.AppendValues(j, "101"); j = treestore.AppendValues(i, "11"); treestore.AppendValues(j, "110"); treestore.AppendValues(j, "111"); tree.AppendColumn(l); // Додавання стовпчика tree.Model = treestore; // Встановлення моделі даних для TreeView tree Add(tree); ShowAll(); } public static void Main() { Gtk.Application.Init(); new SharpApp(); Gtk.Application.Run(); } }