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



On Fri, 16 Mar 2001, Spyro the dragon wrote:

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...)

 Look if it solve your problem:

#include <gtk/gtk.h>

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

        GtkWidget *window;
        GtkWidget *label;
        GtkWidget *hbox;
        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);

        hbox = gtk_hbox_new (FALSE, 5);
        gtk_container_add (GTK_CONTAINER (window), hbox);

        label = gtk_label_new("Records");
        gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_RIGHT);
        gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
        gtk_widget_show (label);
        records  = gtk_entry_new();
        gtk_entry_set_editable(GTK_ENTRY(records), FALSE);
        gtk_box_pack_start (GTK_BOX (hbox), records, FALSE, FALSE, 0);
        gtk_widget_show (records);

        gtk_widget_show (hbox);
        gtk_widget_show (window);


        gtk_main ();
        return 0;
}

 I used an horizontal box. I think that the problem with your code,
its the size of the table, because its to large to put it on main
window, which have an small size.

 You can learning more reading the GTK+ tutorial (before read the
Havoc book). You can found it in: http://www.gtk.org.

 Sorry for my bad english, i hope that you understand.

- Capitulino 







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