Re: Text box problems



Look at this program at the buttom, you can create as many toplevel windows
without getting any xlib errors, you must be doing something wrong in your
code, I get those type of errors when doing forks. Are you doing something of
that type?

Maher

------ cut here -----

/* gcc -o testtextbox testtextbox.c `gtk-config --cflags --libs` */
#include <gtk/gtk.h>


static void make_textbox()
{
     GtkWidget *window, *textbox, *button, *vbox, *sw;
     
     window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
     textbox = gtk_text_new(NULL,NULL);
     button = gtk_button_new_with_label("Create Another one!");
     vbox = gtk_vbox_new(0,0);
     sw = gtk_scrolled_window_new(NULL,NULL);
     gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
GTK_POLICY_AUTOMATIC,
                                    GTK_POLICY_AUTOMATIC);
     gtk_signal_connect(GTK_OBJECT(button), "clicked",
GTK_SIGNAL_FUNC(make_textbox), NULL);
     gtk_text_set_editable(GTK_TEXT(textbox), TRUE);
     gtk_container_add(GTK_CONTAINER(window), vbox);
     gtk_container_add(GTK_CONTAINER(sw), textbox);
     gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, FALSE);
     gtk_box_pack_start(GTK_BOX(vbox), button, TRUE, TRUE, FALSE);
     gtk_widget_show_all(window);
     return;
}

gint main(gint argc, gchar *argv[])
{
     gtk_init(&argc,&argv);
     make_textbox();
     gtk_main();
     return 0;
}

/* end */


On 11 Jan 2001 14:48:47 -0700, Chris Nuernberger said:

    Here is a really basic question about text boxes.  When I use one on
     my first top-level window then it works fine but if I make  another
     top-level window and put a new text widget in it then I get an Xlib
     error, an asynchronous reply.  Thanks for some help, Chris
 
 _______________________________________________
 gtk-app-devel-list mailing list
 gtk-app-devel-list gnome org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 
 

-- 
http://www.muhri.net -- muhri muhri net





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