public WrappersTree(Wrappers.Node parent) : base(false, 0) { d_treeview = new Widgets.TreeView <WrapperNode>(); d_group = parent; TreeViewColumn col; col = new TreeViewColumn(); d_rendererToggle = new CellRendererToggle(); col.PackStart(d_rendererToggle, false); col.SetAttributes(d_rendererToggle, "active", WrapperNode.Column.Checked, "inconsistent", WrapperNode.Column.Inconsistent); d_rendererToggle.Toggled += OnRendererToggleToggled; d_rendererIcon = new CellRendererPixbuf(); col.PackStart(d_rendererIcon, false); col.SetAttributes(d_rendererIcon, "pixbuf", WrapperNode.Column.Icon); d_rendererName = new CellRendererText(); col.PackStart(d_rendererName, true); col.SetAttributes(d_rendererName, "text", WrapperNode.Column.Name, "sensitive", WrapperNode.Column.Sensitive); d_treeview.AppendColumn(col); d_treeview.HeadersVisible = false; d_treeview.NodeStore.SortColumn = 0; d_treeview.ShowExpanders = false; d_treeview.LevelIndentation = 6; d_treeview.EnableSearch = false; d_treeview.SearchColumn = -1; d_treeview.Selection.Mode = SelectionMode.Multiple; d_treeview.StartInteractiveSearch += OnTreeViewInteractiveSearch; d_treeview.RowActivated += OnTreeViewRowActivated; d_treeview.PopulatePopup += OnTreeViewPopulatePopup; d_treeview.KeyPressEvent += OnTreeViewKeyPressEvent; // Keep expanded d_treeview.Model.RowInserted += delegate(object o, RowInsertedArgs args) { TreeRowReference r = new TreeRowReference(d_treeview.Model, args.Path); GLib.Idle.Add(delegate { if (r.Valid()) { d_treeview.ExpandToPath(r.Path); } return(false); }); }; d_treeview.NodeStore.NodeAdded += delegate(Node par, Node child) { WrapperNode n = (WrapperNode)child; n.Toggled += OnNodeToggled; foreach (WrapperNode c in n.Descendents) { c.Toggled += OnNodeToggled; } }; d_treeview.NodeStore.NodeRemoved += delegate(Node par, Node child, int wasAtIndex) { WrapperNode n = (WrapperNode)child; n.Toggled -= OnNodeToggled; foreach (WrapperNode c in n.Descendents) { c.Toggled -= OnNodeToggled; } }; Build(parent); d_treeview.Show(); ScrolledWindow wd = new ScrolledWindow(); wd.SetPolicy(PolicyType.Automatic, PolicyType.Automatic); wd.ShadowType = ShadowType.EtchedIn; wd.Add(d_treeview); wd.Show(); PackStart(wd, true, true, 0); HBox hbox = new HBox(false, 3); hbox.Show(); d_entry = new Entry(); d_entry.Show(); Image img = new Image(Gtk.Stock.Find, IconSize.Button); img.Show(); d_label = new Label(""); d_label.Show(); hbox.PackStart(img, false, false, 0); hbox.PackStart(d_label, false, false, 0); hbox.PackStart(d_entry, true, true, 0); hbox.BorderWidth = 6; PackStart(hbox, false, false, 0); d_entry.Changed += HandleEntryChanged; d_entry.KeyPressEvent += HandleEntryKeyPressEvent; d_treeview.ExpandAll(); d_treeview.NodeStore.Filter(FilterFunc); }