private void EnsureState()
{
if (store.Categorised) {
//LAMESPEC: why can't we just get a TreePath or a count from the NodeStore?
TreePath tp = new Gtk.TreePath ("0");
CategoryToolboxNode node = (CategoryToolboxNode) store.GetNode (tp);
while (node != null) {
if (expandedCategories [node.Label] != null)
nodeView.ExpandRow (tp, false);
tp.Next ();
node = (CategoryToolboxNode) store.GetNode (tp);
}
}
if (selectedNode != null) {
//LAMESPEC: why oh why is there no easy way to find if a node is in the store?
//FIXME: This doesn't survive all store rebuilds, for some reason
foreach (BaseToolboxNode b in store)
if (b == selectedNode) {
nodeView.NodeSelection.SelectNode (selectedNode);
break;
}
}
}