GtkPaned: start and end children width

I am migrating a Pyathon-Gtk3 application to Gtk4 but I cannot set the width of the start and end children of a Gtk.Paned.

I would like the start child to be much narrower than the end child. They are always the same size as you can see in this screenshot:

How can I make start child narrower than 50% of the total with of the window? In Gtk3 I hadn’t have nothing to do because the start child was as narrow as necessary to hold its child.

I am actually facing same issue. I haven’t used Paned before, so I was just following API documentation:

Now, what you want to pay attention to is set_resize_start_child and set_resize_end_child (look example in API page as well). Set resize to true for child you want to expand more (end child in my case, we want start child not to resize/increase in size), set shrink to both to False, and be sure to use set_size_request on child so it would expand pane.

Judging by information it was never meant to automatically collapse to width of child, so you have to do size request anyway after you query and get desired width for your child widget.

Thank you so much :wink:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.