GtkEntry position in GtkTable



Hi,
I  am developing  an application that generates simple dialogues to read

and to manipulate database tables from a relational database. I will use

gtk-table to place the labels and the entries. Entries and labels are on

the left side of the column, in the first column are the labels and in
the second the entries and the dialogues can have 2,4,6... columns and n

rows. I think to have solved the problem of the placement of the labels:



    table = gtk_table_new (n, n, FALSE);
    gtk_widget_show (table);

    label = gtk_label_new ("Label  one:");
    gtk_widget_show (label);
    gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1,
                0, 0, 0, 0);
    gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
    gtk_misc_set_alignment (GTK_MISC (label), 0.05, 0.5);

But I cannot find a solution for entries.
I found a solution for the length of the entry, but not yet for the
placement.

    style = gtk_style_copy (GTK_WIDGET (entry)->style);
        style->font = gdk_font_load

("-adobe-courier-bold-r-normal--14-100-100-100-m-90-iso8859-1");
        space_width = gdk_string_width (style->font, " ");
    entry = gtk_entry_new_with_max_length(1);
    gtk_widget_set_usize(GTK_WIDGET(entry), 1*space_width+10, 0);
    gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, 0, 0, 0, 0);
    gtk_widget_show (entry);

The entry is centralized in the column and I could not find a way to put

it on the left side of the column.
Could somebody help me?
Thanks Bernd



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