I’m writing a Gtk+ menu bar following the instruction here.
When packing the bar onto a VBox with
// "FALSE, TRUE" and "FALSE, FALSE" actually makes no difference
gtk_box_pack_start(GTK_BOX(main_vbox), menu_bar,
TRUE, FALSE, 0);
the menu bar looks terrible, like this:

And when I changed to:
gtk_box_pack_start(GTK_BOX(main_vbox), menu_bar,
TRUE, TRUE, 0);
it looks like:

So, how to make the toolbar get a smaller space allocated?
If I understand your question correctly, you want to:
Therefore, the packing mode of your other widget (namely the button bar below your menu bar) comes into play (for clarity, I’ll refer to them as
button_hboxandmenu_bar, respectively, since both can qualify as “toolbars”).Understanding the boolean layout arguments passed to gtk_box_pack_start() is paramount here:
The first one,
expand, isTRUEif the widget should consume the empty space left in its container after layout is computed. Widgets packed this way compete equally for the remaining space.The second one,
fill, isTRUEif the widget should fill the layout space it consumes instead of being centered within it (there comes the light gray padding).The idea is that you have one (or more, but let’s stick to one for now) main widget in
main_vbox, and that widget is packed with bothexpandandfillset toTRUE. The satellite widgets around it are packed withexpandset toFALSEandfillset toTRUE. For instance:In your case, since you don’t want
menu_barto fill the available space,button_hboxshould do so: