开发者

Remove rows from a Gtk.Treeview with Mono

开发者 https://www.devze.com 2023-02-24 01:08 出处:网络
I have a treeview control( multiple selection supported) with a liststore attached. I need to remove some of the rows at some point. I can do that be clearing the liststore( ListStore.Clear()) and the

I have a treeview control( multiple selection supported) with a liststore attached. I need to remove some of the rows at some point. I can do that be clearing the liststore( ListStore.Clear()) and then repopulating it with items but when I se开发者_如何学编程t the liststore as model of the treeview I get a crash. Anybody has a better solution for removing rows/items from a treeview ?


It shouldn't crash. Are you clearing and populating it from the GUI thread, or some worker thread? GTK+ isn't thread-safe, so if you're using threads make sure you use Gtk.Application.Invoke or similar.

Note that there's also

Gtk.ListStore.Remove (ref TreeIter iter)
0

精彩评论

暂无评论...
验证码 换一张
取 消