It seems that pannable area scrolling after initialize is not working if window is already visible.
Attached a sample code and if you uncomment line 61 it is not working anymore
But via button click then the same code is working.
And in both cases widget is maped and realized.
It seems that pannable area scrolling after initialize is not working if window is already visible.
One possibility is that scroll_to_child() only works reliably after the event loop has started. You might use gobject.timeout_add() (or gobject.idle_add()) to add the scrolling as an asynchronous event.
I attached a (working) example showing how to use gobject.timeout_add(). In the example the pannable area scrolls to a random button every 2 seconds.