// ------------------------------------------------------------------------------ // // This code was generated by a tool. // Mono Runtime Version: 1.1.4322.2032 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // // ------------------------------------------------------------------------------ using Gtk; using GLib; using System; namespace AdaptorTest { public class Person { private string name; public string Name { get { System.Console.WriteLine ("reads name"); return name; } set { System.Console.WriteLine ("writes name"); name = value; } } public Person (string name) { this.name = name; } } public class MainWindow : Gtk.Window { public MainWindow() : base ("Test") { Stetic.Gui.Build(this, typeof(MainWindow)); int i = 0; Person [] persons = new Person [10]; for (i=0; i<10; i++) persons[i] = new Person ("Person "+ i.ToString()); TreeViewAdaptor v = new TreeViewAdaptor (); v.Show(); Gtk.CellRenderer celr = new Gtk.CellRendererText(); celr.Visible = true; celr.Width = 100; v.AppendColumn ("Full Name", "Name", GLib.GType.String, celr, null); v.ListAdaptor = new ListAdaptor (persons); this.Add (v); this.DeleteEvent += new Gtk.DeleteEventHandler (OnDeleteEvent); } protected virtual void OnDeleteEvent(object o, Gtk.DeleteEventArgs args) { Application.Quit(); } } }