[Glade-users] Im having problems putting text in a textwidget

Magnus-swe wrote:


I need to put text in a textwidget from Main.c

I take the text from a file and just want to show the text in the
when the program starts, i can set text from callbacks.c
but it wont work from Main.

It should work OK in main.c. (There used to be a problem where you
couldn't set the text before the widget was realized but I think that
was fixed before GTK+ 1.2.0.)


  GtkWidget *window, *text;
  char *s;

  window = create_window1 ();
  text = lookup_widget (window, "text1");
  s = "Hello World!";
  gtk_text_insert (GTK_TEXT (text), NULL, NULL, NULL, s, strlen (s));

This just worked OK for me.


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