Re: something basic



Vicki Stanfield wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> I think I'm missing something very basic here. I am trying to add
> a few widgets into a box in such a way that the box expands to hold
> the child widgets and the text widget expands to show all text. I
> am obviously missing the boat here since neither happens. I am including
> the code that produces the wrong result with the stuff that works cut
> away.
> 
> /*
>  * CreateMainWindow
>  *
>  * Create the main window and the menu/toolbar associated with it
>  */
> static void CreateMainWindow ()
> {
>     GtkWidget *vbox_main;
>     GtkWidget *vbox;
>     GtkWidget *vbox2;
>     GtkWidget *vbox3;
>     GtkWidget *text;
>     GtkWidget *enterprompt;
>     GtkWidget *entry_widget;
> 
>     /* --- Create the top window and size it. --- */
>     win_main = gtk_window_new(GTK_WINDOW_TOPLEVEL);
> 
>     /* --- Let the window to be resized. --- */
>     gtk_window_set_policy (GTK_WINDOW (win_main), FALSE, TRUE, FALSE);
> 
>     /* --- Title --- */
>     gtk_window_set_title (GTK_WINDOW (win_main), "Anvil Cash");
>     gtk_container_set_border_width (GTK_CONTAINER (win_main), 5);
> 
>     /* --- Top level window should listen for the destroy --- */
>     gtk_signal_connect (GTK_OBJECT (win_main), "destroy",
>               GTK_SIGNAL_FUNC(ExitProgram), NULL);
> 
>     /* --- Create v-box-main for win_main --- */
>     vbox_main = gtk_vbox_new (FALSE, 0);
> 
>     /* --- Put up v-box --- */
>     gtk_container_add (GTK_CONTAINER (win_main), vbox_main);
> 
>     /* --- Create v-box for menu --- */
>     vbox = gtk_vbox_new (FALSE, 0);
> 
>     /* --- Put up v-box --- */
>     gtk_box_pack_start (GTK_BOX (vbox_main), vbox, FALSE, TRUE, 0);
                                                     ^^^^^

You probably want to pass TRUE as the expand argument, not FALSE.

(And the same goes in another few places.)

Damon




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