GtkList multiselect



I have used GtkList (gtk2 2.8.20-7 according to synaptic) in the past in my apps, but now I need to add multiselect ability. It seemed like it
would be easy, but it doesn't work right! Changing nothing but adding:

               gtk_list_set_selection_mode(GTK_LIST(list_widget),
GTK_SELECTION_MULTIPLE);

Causes some very odd behavior.

1) Every unmodified left click on the items causes them to be _added_ to
the selection. You have to control-click on an item to deselect it.

2) GTK_LIST(list_widget)->select is always empty! If I walk the
GTK_LIST(c->list_widget)->children list I can tell what is selected with
GTK_WIDGET(items->data)->state == GTK_STATE_SELECTED but that seems a
bit of a hack.

3) "selection-changed" signal is never emitted

4) "select-child" is emitted, but "unselect-child" is only emitted for
selected items when the list is destroyed (not sure exactly when the
unselect-child signal is sent, but it doesn't occur until the dialog is
dismissed, once for each item still selected when closed)

I can deal with all of them but #1. Very ugly behaviour. Is this the way
it was supposed to work?

***************************************

I realize that GtkList is depreciated. I rewrote the code to use GtkTree
but besides the 10x increase in complexity it can't display all of my
lists.  I don't see a way to display rows which are arbitrary
collections of text and pixmaps. In other words, the number and type of
columns can vary from row to row. In GtkList it was easy to simply pack
the items into each row.

So if a solution for this exists I'm happy to skip GtkList all together.

***************************************

I appreciate the work done for GtkTree, but it does seem like mouse
hunting with an elephant gun for 90% of lists. Perhaps some other widget
exists that I am missing that would be a better replacement for GtkList??

Thanks for your advice,

Deron



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