Re: GLib-CRITICAL Source ID 35 was not found when attempting to remove it
- From: Christian Hergert <christian hergert me>
- To: Lokesh Chakka <lvenkatakumarchakka gmail com>, GTK Devel List <gtk-devel-list gnome org>
- Subject: Re: GLib-CRITICAL Source ID 35 was not found when attempting to remove it
- Date: Tue, 15 Sep 2015 23:27:24 -0700
On 09/15/2015 09:03 PM, Lokesh Chakka wrote:
> static void *thread_function( void *parameter )
> {
> const int seconds = 1000;
>
> for( i=0; i<seconds; i++ )
> {
> gtk_widget_queue_draw( (GtkWidget*)darea );
> sleep(1);
> }
> }
It's not okay to touch Gtk+ widgets from a thread other than the main
thread owning the gtk main loop.
Try using g_timeout_add() to get a callback within the mainloop and do
your gtk_widget_queue_draw() from there.
-- Christian
[
Date Prev][
Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]