Bug in CList remove_row?



I think I've found a possible bug in the CList widget in version 1.1.7
that wasn't there in 1.0. Basically when removing a selected row, it
sometimes puts the selection in the wrong place, or removes the
selection altogether. I'm using GTK_SELECTION_BROWSE.

I add an item to the clist and select and move to it like this:

    int row_number = list_->append(row);
    list_->set_row_data(row_number, (void*)(a->Get_ID())); 
    list_->cause_select_row(row_number, 0);
    list_->moveto(row_number, 0, 0, 0);

And I remove the selected item like this:

    int row_number = list_->find_row_from_data((void*)(a->Get_ID()));
    list_->remove_row(row_number);

If you explicitly select a row with the mouse, the remove_row seems to
work properly, but if you just add a bunch of rows using the above code,
and then immediately try to delete the selected row, it does delete it,
but either makes the selection disappear (even though there are still
rows and I'm using GTK_SELECTION_BROWSE) or it puts the selection in the
wrong place. Since I'm causing the newly appended row to be selected, it
is always the last row that is being deleted in this case.

Is cause_select_row not doing something it should do that explicitly
selecting with the mouse does?

--
Michael Babcock
Jim Henson's Creature Shop - Los Angeles
mbabcock@la.creatureshop.henson.com



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