Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6254129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T14:07:58+00:00 2026-05-24T14:07:58+00:00

I’m writing a Gtk+ menu bar following the instruction here . When packing the

  • 0

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:

slim menu bar

And when I changed to:

 gtk_box_pack_start(GTK_BOX(main_vbox), menu_bar,
                    TRUE, TRUE, 0);

it looks like:

enter image description here

So, how to make the toolbar get a smaller space allocated?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T14:07:58+00:00Added an answer on May 24, 2026 at 2:07 pm

    If I understand your question correctly, you want to:

    1. Get rid of the light gray padding around the menu bar.
    2. Do the above without expanding the menu bar to fill the available space.

    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_hbox and menu_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, is TRUE if 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, is TRUE if 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 both expand and fill set to TRUE. The satellite widgets around it are packed with expand set to FALSE and fill set to TRUE. For instance:

    +-------------------------------------------+
    |  Menu bar: expand = FALSE, fill = TRUE    |
    +-------------------------------------------+
    |  Toolbar: expand = FALSE, fill = TRUE     |
    +-------------------------------------------+  ^
    |                                           |  |
    |                                           |  |  The height of this widget
    |  Main widget: expand = TRUE, fill = TRUE  |  |  varies depending on the 
    |                                           |  |  height of its container.
    |                                           |  |
    +-------------------------------------------+  v
    |  Status bar: expand = FALSE, fill = TRUE  |
    +-------------------------------------------+
    

    In your case, since you don’t want menu_bar to fill the available space, button_hbox should do so:

    // Menu bar: satellite widget, expand = FALSE, fill = TRUE
    gtk_box_pack_start(GTK_BOX(main_vbox), menu_bar, FALSE, TRUE, 0);
    
    // Button bar: main widget, expand = TRUE, fill = TRUE
    gtk_box_pack_start(GTK_BOX(main_vbox), button_hbox, TRUE, TRUE, 0);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am writing an app with both english and french support. The app requests
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.