New to gtk+... whats up with this?



It is my desire to create something that produces this layout

O=================thingy======================X
+----------------+----------------------------+
|                | +------------------------+ |
|         Records| |                        | |
|                | +------------------------+ |
+----------------+----------------------------+


but what I get looks more like:

O==========================================thingy==============================================X
+----------------+-----------------------------------------------------------------------------+
|                |
+------------------------+                                                 
|
|    Records     | |                       
|                                                  |
|                |
+------------------------+                                                 
|
+----------------+-----------------------------------------------------------------------------+

the text box resizes, but the label does NOT. the text box never seems
to fill the available space, either.

the code is below.

Any help appreciated. (or tell me to f*ck off if im in the wrong
place...)

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


int main( int   argc, char *argv[] ){

        GtkWidget *window;
        GtkWidget *label;
        GtkWidget *table;
        GtkWidget *records;


        gtk_init (&argc, &argv);

        window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
        gtk_window_set_title (GTK_WINDOW (window), "thingy");
        gtk_container_set_border_width (GTK_CONTAINER (window), 20);

        table = gtk_table_new(2, 5, TRUE);
        gtk_container_add(GTK_CONTAINER (window), table);

        label = gtk_label_new("Records");
        gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_RIGHT);
        gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL,
GTK_FILL, 0,0);

        records    = gtk_entry_new(); 
gtk_entry_set_editable(GTK_ENTRY(records), FALSE);
        gtk_table_attach (GTK_TABLE(table), records, 1, 2, 0, 1,
GTK_FILL, GTK_FILL, 0,0);
    
        gtk_widget_show_all(window);

        gtk_main ();
        return 0;
}




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