Re: GTK Queue Draw Subtle Question
- From: Paul Davis <paul linuxaudiosystems com>
- To: Thomas Dineen <tdineen ix netcom com>
- Cc: ML-gtk <gtk-list gnome org>
- Subject: Re: GTK Queue Draw Subtle Question
- Date: Thu, 16 Feb 2017 09:42:24 +0100
Sad to say, it seems that you're in a common position of not understanding the basic structure of a GUI program. In its simplest form, it looks like this:
main ()
{
initialize_stuff();
while (not_time_to_quit()) {
wait_for_events_and_timeouts ();
process_events_and_timeouts ();
if (redraws_requested) {
do_redraw ();
}
}
finalize_stuff ();
}
your menu handlers execute as part of "process_events_and_timeouts ()". You can see that if they take a long time, you are necessarily preventing the program from reaching the "do_redraw()" stage.
you need to refactor your code so that either your menu handlers do not take so long or you execute them in a different thread, and then use an idle handler to queue a redraw in any relevant widgets when they are done (queuing an idle handler is the one and only GTK-related thing you can do from the other thread(s)).
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]