Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TreeModelFilter generateArtistFilter(in string artistName) {
- static string* s_an = artistName.ptr; // Error: variable artistName cannot be read at compile time
- // nested private function
- static extern (C) int fn(GtkTreeModel* m, GtkTreeIter* i, void* data) {
- TreeModel model_ = new TreeModel(m);
- TreeIter iter = new TreeIter(i);
- string name = model_.getValue(iter, COLUMNS.ARTIST).getString();
- return name == *s_an;
- }
- auto filter = new TreeModelFilter(model, null);
- filter.setVisibleFunc(&fn, null, cast(GDestroyNotify) null);
- return filter;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement