gi-gtk-declarative
gi-gtk-declarative copied to clipboard
ListBox content change leads to cursor position reset
I have a ListBox
with some children. Now I select a row in the ListBox
, and press a button that changes the content of the selected row (say, by changing a Label
to "installed"). This seems to completely reset the ListBox
selection (so that no item is selected).
I sort of get the problem here, but I'd love to somehow manage the selection myself, and ideally by using an index, so the selection is kept, even on change.
As I understand it, you should be able to change the content of a selected row without loosing selection, so long as the the changes don't require re-creating the entire row widget. Changing the text on a Label
should not require recreating the Label
, so that should work, I think. Could you paste a code sample?
As for managing the selection yourself, right now I think you would have to make a custom widget for this (see https://github.com/owickstrom/gi-gtk-declarative/blob/master/examples/CustomWidget.hs).