PDA

View Full Version : tree 如何取消选择



prosteven2
June 22nd, 2009, 06:10 AM
tree view,单击item,可以展开,并加亮显示。这是默认行为。

现在,如果通过调用函数gtk_tree_selection_select_path选择另一个item ,如何使当前选中的item不再加亮显示?

以下方法无效,不能取消原先选中item的加亮状态:

GtkTreeSelection* sel = gtk_tree_view_get_selection( GTK_TREE_VIEW(dir_tree_view_widget) );
gtk_tree_selection_unselect_path( sel, current_dir_tree_path );

图解:

root
|
|-item1
|
|-item2
|
...

选中item1,调用函数gtk_tree_selection_select_path选中item2, item1如何取消选中状态,不再加亮显示?

unknownPoster
June 22nd, 2009, 03:50 PM
you might want to post this in English...

soltanis
June 22nd, 2009, 08:44 PM
Yeah, this forum is English only. I forget where the Chinese forums are unfortunately, someone here should know though...

prosteven2
June 23rd, 2009, 02:20 AM
thanks