PyGtk3,如何防止 VBox 中的水平扩展?

PyGtk3, How to prevent horizontal expand in VBox?

我可以使用 pack_start(button, expand = False, fill = False, padding = 0) 命令阻止 VBox 中的垂直扩展,但 VBox 中的小部件总是扩展水平地。我想在水平面的中心制作小部件。有没有一种方法可以让小部件在水平面上居中?

set_halign()方法可以做到这一点

button = Gtk.Button()
button.set_halign(Gtk.Align.CENTER) # to center the widget

button = Gtk.Button(halign = Gtk.Align.CENTER)