Re: Thread created by g_thread _create() cannot write to memory

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

 



Hi elmo,

First of all, see the corresponding FAQ entry

	http://gtk.org/faq/#AEN482

Now for your program:

>    gtk_init(&argc, &argv);
>    g_thread_init(NULL);

Do:

  g_thread_init(NULL);
  gdk_threads_init();
  gtk_init(&argc, &argv);

>    gtk_main();

Do:

  gdk_threads_enter();
  gtk_main();
  gdk_threads_leave();

>    gtk_label_set_text( GTK_LABEL(ThisInst->timer_widget), "aaa"); //DOESN"T WORK! SEGFAULTS!

Do:

  gdk_threads_enter();
  gtk_label_set_text( GTK_LABEL(ThisInst->timer_widget), "aaa"); //WORK'S LIKE A CHARM!
  gdk_threads_leave();

Bye,
Sebastian
-- 
Sebastian Wilhelmi                 |            här ovanför alla molnen
mailto:seppi@xxxxxxxx              |      är himlen så förunderligt blå
http://seppi.de                    |


_______________________________________________

gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list


[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux