GtkTree selection problem



I am new to developing in GTK, and am using a GtkTreeView to display a
list.  I have set the selection mode to GTK_SELECTION_MULTIPLE, but when
I click on items in the list, the selection mode does not behave as I
think it should. Items that are selected are shown with highlighting, so
when I click on an item that is highlighted, it should unselect and lose
the highlighting, but it doesn't.  If I click on another item in the
list that is not highlighted, the original item loses its highlighting
and the new item is highlighted, which is what I think should happen. To
check on this behaviour, I implemented the
gtk_tree_selection_set_select_function that is shown in Chapter 6 of the
GTK TreeView tutorial (code in section 6.1.3) and it shows, when I click
on a highlighted item, that it is going to be unselected.  But it never
is unselected. Repeated clicks on the same item, which should be
toggling the selection state, always give the same message, that the
item is going to be unselected. I also implemented a callback function
on the list that shows the number of items in the list that are selected
(just in case highlighting has nothing to do with selection) and I can
never get less than one item selected in the list.  This would be the
correct behaviour for GTK_SELECTION_SINGLE, but not for
GTK_SELECTION_MULTIPLE

Can anyone tell me what I am missing here?




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]