Re: Visibility of pop_up windows



Colin Thomas <colin designresources co uk> writes:

I have been writing an application, which has pop_up windows when a
warning need to be displayed.

There seems to be a scheduling issue with the windows painting.

When the pop_up window is invoked, just a grey outline is painted. The whole
window does not get repainted until the function calling it has completed
and the code is in "idle" state. This can be a few minutes, so the display
looks unprofessional

How can I get the pop_up window to paint "in-full" before anything else 
occurs?

That won't help - if you lock up your program doing some calculation,
the user can obscure the dialog and it will again go blank and need
repainting. So finishing the paint before you lock up the program
doesn't get you very far, it just postpones the issue. (That said, no
I don't know of a good way to force the paint before you enter your
calculation.)

The basic deal is that GUI programs can't block or lock up.

There are many ways to avoid that:

 - separate process for the calculation
 - separate thread for the calculation
 - perform the calculation or I/O incrementally/asynchronously

gtk_timeout_add(), gtk_idle_add(), and g_io_add_watch() are useful
here, depending on what you're doing that locks up the program.

Havoc





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