Search code examples
c#gtkgtk#

How to set minimal and current size of the RIGHT pane in HPaned in Gtk?


I am trying to make application window with movable separator between left and right pane. On the left pane, I have a ListView. On the right pane, I have a VBox with some labels, entries, etc. I have added HPaned container, added ListView to its left pane and VBox to its right pane. Pretty simple.

And there goes the problem:

  1. I need to make right pane to save its size when user resizes the window. Although, it seems the only supported behavior is when left pane does so.

  2. I need to set a minimal width for right pane so it will not be too small if the user tries to resize it, or, cuz of first problem, just resizes the window to smaller size. I did not find any way to do that. Actually, I can use Window.SetGeometryHints() to add a minimal constraint for VBox on right pane, but is it the only way to do it? All these constraints make window being jerky when I am resizing it.


Solution

  • Okay, after few experiments I found a solution for first problem. It is enough to call Pack1(widget, true, true) for left pane child, and Pack2(widget, false, false) for right pane child.

    Solution for second problem would be to add MinSize constraint for right pane child with Window.SetGeometryHints(), but it seems what the window becomes unshrinkable by user.

    If someone knows correct way to solve second problem, your help is very appreciated.