示例#1
0
        protected void TestExpandRow(object o, TestExpandRowArgs args)
        {
            // Add to the expandedNodes table
            string fullName = (string)GtkStore.GetValue(args.Iter, LocalsStore.ColumnFullName);

            expandedNodes[fullName] = null;             // No value, just insert the key

            // Notify remote store
            RemoteTreeNodeRef nodeRef = (RemoteTreeNodeRef)GtkStore.GetValue(args.Iter, LocalsStore.ColumnReference);

            remoteStore.ExpandNode(nodeRef);

            GtkTreeStoreUpdater.Update(remoteStore, GtkStore);

            TreeIter it;

            GtkStore.GetIter(out it, args.Path);
            int childCount = GtkStore.IterNChildren(it);

            if (childCount == 0)
            {
                args.RetVal = true;                  // Cancel expanding
            }
            else
            {
                args.RetVal = false;
            }
        }
示例#2
0
        public override void ReceiveUpdates()
        {
            GtkTreeStoreUpdater.Update(remoteStore, GtkStore);

            int childCount = GtkStore.IterNChildren();

            for (int i = 0; i < childCount; i++)
            {
                TreePath childPath = new TreePath(new int[] { i });

                TreeIter childIter;
                GtkStore.GetIter(out childIter, childPath);
                string childFullName = (string)GtkStore.GetValue(childIter, LocalsStore.ColumnFullName);
                // This node was expanded in the past - expand it
                if (expandedNodes.ContainsKey(childFullName))
                {
                    GtkTree.ExpandRow(childPath, false);
                }
            }
        }
示例#3
0
 public override void ReceiveUpdates()
 {
     GtkTreeStoreUpdater.Update(remoteStore, GtkStore);
 }