Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ListBox content change leads to cursor position reset #82

Open
pmiddend opened this issue Apr 7, 2020 · 1 comment
Open

ListBox content change leads to cursor position reset #82

pmiddend opened this issue Apr 7, 2020 · 1 comment

Comments

@pmiddend
Copy link

pmiddend commented Apr 7, 2020

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.

@Dretch
Copy link
Collaborator

Dretch commented Apr 25, 2020

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants