menu bar grows



Greetings.

I am new to GTK programming, and I've run into a problem I can't work my
way around.

I'm creating a menu in my GTK program.  The menu works fine.  However,
my GTK program has a vbox that grows and shrinks vertically.  When my
vbox grows, the top of the X window is "anchored" and the bottom of
the X window moves down to fit the new data.  However, when my vbox
shrinks, the X window stays the same size, and the menu bar expands
vertically to fill up the empty space.  I would prefer that the bottom
of the X window move up to fit the new data size.

I'm sure there's an option that I missed somewhere, but I can't find it.
Help would be appreciated.

    gtk_init (&argc, &argv);
    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);

    box = gtk_vbox_new(FALSE,0);
    gtk_container_add (GTK_CONTAINER (window), box);

    menu = gtk_menu_new();
    menuQuit = gtk_menu_item_new_with_label ("Quit");
    gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuQuit);
    gtk_widget_show(menuQuit);
    g_signal_connect (menuQuit, "activate",
                           G_CALLBACK (quit), NULL);

    menubar = gtk_menu_bar_new( );
    gtk_box_pack_start (GTK_BOX (box), menubar, TRUE, TRUE, 0);
    gtk_widget_show(menubar);
    menuItem = gtk_menu_item_new_with_label("MahJong");
    gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuItem), menu);
    gtk_widget_show (menuItem);
    gtk_menu_bar_append (GTK_MENU_BAR (menubar), menuItem);

--hymie!    http://lactose.homelinux.net/~hymie    hymie lactose homelinux net
-------------------------------------------------------------------------------


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]