GtkBox minimum height: Expect overlapping widgets

An error recently showed up on my GTK app that I have been unable to diagnose. I have 4 horizontal GTKBox’s in a vertical parent GTKBox. Inside each horizontal GTKBox are rows of 5-10 children (GTKButtons) each with GTKLabel children of their own.
These 4 horizontal GTKBoxes raise the following error:

test:66318): Gtk-CRITICAL **: 14:27:33.423: GtkBox 0x55a9123a2760 reports a minimum height of 180, but minimum height for width of 1048576 is 192. Expect overlapping widgets.

(test:66318): Gtk-CRITICAL **: 14:27:33.423: GtkBox 0x55a9123a25e0 reports a minimum height of 180, but minimum height for width of 1048576 is 204. Expect overlapping widgets.

(test:66318): Gtk-CRITICAL **: 14:27:33.423: GtkBox 0x55a9123a2460 reports a minimum height of 180, but minimum height for width of 1048576 is 217. Expect overlapping widgets.

(test:66318): Gtk-CRITICAL **: 14:27:33.423: GtkBox 0x55a9123a22e0 reports a minimum height of 190, but minimum height for width of 1048576 is 202. Expect overlapping widgets.

It’s a bizarre error. Is there any way to reduce the GTKBox’s widths so that they are not at 1 million pixels?

Furthermore, the height allocation for each GtkBox seems to depend on its width, i.e. the number of Button children it contains. EDIT: this is due to GTK’s height-for-width property. In the photo below, the two wider GtkBoxes have height of 194, while the two thinner GtkBoxes have a height of 182.

This is a result of GTK lacking a height property, so I only specified min-height. If I remove min-height entirely, I would have expected the GtkBoxes to fill the window automatically. Instead, they shrink to only encompass the text, as below. Removing the min-height also removes the error in my first post.


Any ideas on how to give each horizontal GTK Box a uniform height that still fills the window?
For example, in css you have the viewport-height option, so I could just set each row to have a height of 25vh.

gtk_widget_set_vexpand(widget, TRUE) will allow widgets to fill all available space.

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