What I would like to be able to do is set the GtkPaned separator to a specific value when adding it as a child of the GtkNotebook. In order to do that, I use the following sequence of calls:
Widgets are allocated within the frame cycle, so you cannot just build your scene graph and assume everything will be valid. That’s why we have signals and properties to let you know when values are set.
Widgets need to be realized and mapped, in order to have an allocation; just toggling the visibility flag isn’t enough. This means that a widget needs to have a top-level associated to it, as the allocation flows from the top level down to the leaf widgets; additionally, an allocation can only be derived by querying the preferred size of each widget in the graph.
In practice, a widget will only ever have a valid allocation when the GtkWidget::size-allocate signal is emitted, or when the widget is drawn.
So, to clarify, the correct way to do what I am after is to connect the page child widget’s size-allocate signal to a handler, which will set the GtkPaned separator position and then just disconnect the signal?
The appropriate way would be to wait until the size-allocate, then schedule an idle callback to set the separator position in the GtkPaned. Setting the separator position will queue a relayout, and than cannot happen from within the size allocation. You need to re-enter the main loop to avoid layout cycles.