How to calculate size of gtk4-rs widget with custom function

72 views Asked by At

I have custom subclass of gtk::Box, I need to make it calculate width based on parent(50% for example) and height using aspect ratio that needs to be specified.

I tried implementing size_allocate using WidgetImpl, but when using println! inside of it nothing happened(I tried calling object.size_allocate but it is different function probably).

1

There are 1 answers

2
Kripto On BEST ANSWER

What you need is gtk constraints