void filterTextChanged(object sender, EventArgs e) { foreach (Category cat in toolboxWidget.Categories) { bool hasVisibleChild = false; foreach (Item child in cat.Items) { child.IsVisible = ((ItemToolboxNode)child.Tag).Filter(filterEntry.Text); hasVisibleChild |= child.IsVisible; } cat.IsVisible = hasVisibleChild; } toolboxWidget.QueueDraw(); }
void refilter() { foreach (Category cat in toolboxWidget.Categories) { bool hasVisibleChild = false; foreach (Item child in cat.Items) { child.IsVisible = ((ItemToolboxNode)child.Tag).Filter(filterEntry.Entry.Text); hasVisibleChild |= child.IsVisible; } cat.IsVisible = hasVisibleChild; } toolboxWidget.QueueDraw(); toolboxWidget.QueueResize(); }