PyGTK Treeview automatic filters on each column

时间:2016-10-20 19:09:11

标签: python gtk pygtk

I have created a TreeView with several columns and the corresponding ListStore that holds the data.

What I would like to do now is to automatically create a dropdown under each column that will hold the distinct values of that column and perform filtering. So basically I want to create an excel like auto filter functionality.

Can this be achieved via the TreeView control? Are there any other controls out in the wild that can provide something like that?

1 个答案:

答案 0 :(得分:0)

我在Python中使用过TreeView / TreeStore,但我还没有尝试过你想要的东西。不过,C文档中有一些很有前途的东西:

因此我觉得你拿走Gtk.TreeViewColumn对象,打电话给col.set_widget(my_menu_widget),可能打电话给col.set_clickable(True),鲍勃是你的叔叔。