Why doesn't the newly added widget have a selection?
I want to add a widget to the bottom of a scrolled window and then scroll to the end of that window. However, the window thinks it is already at the bottom because the widget is still not selected. Ie, this returns -1:
widget.get_allocation().y
Why is this? Is there a way to force the widget to be highlighted so that I can adjust the window accordingly? Or is there a better solution?
+1
a source to share
2 answers
The best solution is to connect a signal to the size-allocate element and defer the scrolling calculation until then.
+1
a source to share
I'm not 100% sure, I understand what you are trying to do, but still: at a minimum, you need to realize the widget to make it calculate these things. But see the note in the linked documentation and see if these methods don't work.
0
a source to share