Adjust GtkApplication window to content

I have an application that I am porting from GTK3 to GTK4.

It has two GtkDrawing widgets and a set of controls (in GtkBoxes on the left) (see below).

I have a radio button that chooses a different display that only uses one of the drawing widgets, so I make the second invisible. This leaves a lot of blank space that I want to remove by shrinking the GtkApllication widget to match the smaller content. (shrink wrap the application window). I can do this manually by grabbing the edge with the mouse and dragging it in (see bottom image) but I would like to do this programmatically.

I did this with GTK3 (with a lot of difficulty). Is it possible to do this with GTK4? If so how?

Michael

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