[Gtk#] TreeModelFilter - it not filter at all.
- From: Uzytkownik <uzytkownik2 gmail com>
- To: gtk-app-devel-list gnome org
- Subject: [Gtk#] TreeModelFilter - it not filter at all.
- Date: Mon, 16 Jan 2006 17:50:05 +0000 (UTC)
public class Kategorie : VBox {
public Kategorie() {
//...
PackStart(szukaj = new Entry(), false, false, 0); {
szukaj.Changed += delegate {filter.Refilter();};
} szukaj.Show();
PackStart(tv = new TreeViewPopup(menu)); {
TreeViewColumn kategorie = new TreeViewColumn(); {
//...
} tv.AppendColumn(kategorie);
ls = new ListStore(new Type[]{typeof(Kategoria)}); {
//Adds content
} filter = new TreeModelFilter(ls, null); {
filter.VisibleFunc = new TreeModelFilterVisibleFunc(Kat_Find);
} tv.Model = filter;
tv.HeadersVisible = true;
} tv.Show();
}
private bool Kat_Find(TreeModel model, TreeIter iter) {
String nazwa = (model.GetValue(iter, 0) as Kategoria).Nazwa;
if(szukaj.Text == "")
return true;
return (nazwa.IndexOf(nazwa) > -1);
}
//Some functions
private TreeView tv;
private ListStore ls;
private Menu menu;
private Entry szukaj;
private TreeModelFilter filter;
}
I use http://www.mono-project.com/GtkSharp_TreeView_Tutorial.
What's wrong?
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]