First I looked at the get_size_request
method. The docs there end with:
To get the size a widget will actually use, call the
size_request()
instead of this method.
I look at size_request()
, and it ends with
Also remember that the size request is not necessarily the size a widget will actually be allocated.
So, is there any function in GTK to get what size a widget actually is? This is a widget that is on-screen and actually being displayed, so GTK definitely has this information somewhere.
This should be it (took some time to find):
The get_allocation() method returns a gtk.gdk.Rectangle containing the bounds of the widget's allocation.
From here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With