Re: Repainting/Redrawing widgets



I tried adding:

gtk_widget_draw(widget, NULL);

But that seems to not work.

Is there anyway of updating the widgets from a pthread? Or perhaps should I be using GTK Threads?

-------
Alvin Beach
Email: alvinbeach hotmail com
Website: http://www.vianet.ca/~abeach




From: "A B" <alvinbeach hotmail com>
To: gtk-app-devel-list gnome org
Subject: Repainting/Redrawing widgets
Date: Thu, 27 Mar 2003 18:41:45 -0500

Hello everyone,

I have been messing around with GTK+ 2.0. In the application that I am creating, I have a GtkDialog. In that dialog I have a GtkProgressBar. Now, I'm sure you have all guessed my problem by now ;). The actual work is being done in a pthread. Inside that pthread I am making it update the value of the GtkProgressBar. Unfortunately, this update is not being drawn? If I move the mouse over the GtkDialog then the GtkProgressBar displays the "new" value.

I have been experimenting with different ways of getting it to update. From what I understand is that the main GTK loop handles the redrawing. Therefore, when the value is changed, it wont be displayed until the main loop gets to it. I have tried the:

while(gtk_events_pending())
  gtk_main_iteration();

but I get the following error:

GLib-WARNING **: g_main_context_prepare(): main loop already active in another thread

Does anyone know of a way around this?

-------
Alvin Beach
Email: alvinbeach hotmail com
Website: http://www.vianet.ca/~abeach



_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail




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