Re: problems with the redraw of widgets and callbacks with long operation time



rsteinke w-link net wrote:

From: Ignacio Nodal <inodal teleline es>

Hi,

In my program I have a window where I select a VRML file to load, press OK and in the button callback, I hide this window and call my function to read the VRML file (I use CyberVRML97 for this).

The problem is that my GTK+ application seems to be freezed during the load. The main window doesn't care about my "expose_event" callback until the load ends.

I don't like this behaviour,  how could I avoid this?


You're probably not giving the mainloop any time to run during the load.
Look at the documentation on the gtk mainloop (or, better, the glib mainloop)
for instructions on how to do this.

Ron Steinke




I've tried with:

 while (gtk_events_pending())
	gtk_main_iteration();

before calling my VRML load function, but gtk_events_pending returns 0.

I've also asked for gdk_events_pending, since i'm working with GtkGLArea, being a "subclass" of GtkDrawingArea , but this one returns 0 also.

I'm a bit lost...

Thanks in advance,

Ignacio




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