GtkBox 中心中心内容

GtkBox center center contents

我有一个带有三个内部组件的水平 GtkBox

short left | A large mid component | medium right

我希望尺寸为

x | y | x

其中 x=max(左短,右中),因此 A large mid component 居中。我尝试将 expandfill 用于 short leftmedium right,因为根据文档:

The extra space will be divided evenly between all children of box that use this option

但是真的很像"The extra space will be divided such that the ratio of the sizes ... are preserved",这不是我想要的。正确的解决方案是什么?

使用 GtkSizeGroup 并将最外面的两个小部件添加到其中。