If my understanding of the documentation is correct, then if I have a GtkPaned with resize-end-child=False and resize-start-child=True, then when that GtkPaned resizes, the extra space should be consumed by the start child first.
I have a layout with a GtkPaned as the child of my main window. When I resize the window, despite having resize-end-child=False and resize-start-child=True, it is the end child that resizes to take up the new space.
Are there some conditions that I have missed for making this work?
I tried changing various halign/hexpand properties on the children, and had no luck.
testui.xml
<?xml version='1.0' encoding='UTF-8'?>
<interface>
<requires lib="gtk" version="4.6"/>
<object class="GtkApplicationWindow" id="mainwindow">
<property name="default-height">600</property>
<property name="default-width">800</property>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<child>
<object class="GtkPaned" id="mainpane">
<property name="wide-handle">True</property>
<property name="orientation">vertical</property>
<property name="resize-end-child">False</property>
<property name="resize-start-child">True</property>
<property name="end-child">scrolltext</property>
<property name="start-child">images</property>
<child>
<object class="GtkPaned" id="images">
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="halign">fill</property>
<property name="wide-handle">True</property>
<child>
<object class="GtkDrawingArea">
<property name="content-height">230</property>
<property name="content-width">230</property>
</object>
</child>
<child>
<object class="GtkDrawingArea">
<property name="content-height">400</property>
<property name="content-width">400</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolltext">
<property name="child">log</property>
<child>
<object class="GtkTextView" id="log">
<property name="buffer">
<object class="GtkTextBuffer"/>
</property>
<property name="editable">False</property>
<property name="height-request">300</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>
test.py
#!/usr/bin/env python3
import sys
import gi
gi.require_version("Gtk", "4.0")
from gi.repository import GLib, Gtk
class MyApplication(Gtk.Application):
def __init__(self):
super().__init__(application_id="com.example.MyGtkApplication")
GLib.set_application_name('My Gtk Application')
def do_activate(self):
builder = Gtk.Builder()
builder.add_from_file("testui.xml")
self.win = builder.get_object("mainwindow")
self.win.set_application(self)
self.win.present()
app = MyApplication()
exit_status = app.run(sys.argv)
sys.exit(exit_status)