At risk of being a huge pain in the ass to you fine and knowledgeable folks, I have now done a fair bit of reading and some experimenting with the g_idle_add () functions, and I'm still not seeing what I think I should see. I have attached another version of my test program with the button and a window with a label. As you can see, I have now added a function with the lowest possible priority that will sleep for 3 seconds after the subwindow with the label is created. By giving the sleeper function the lowest possible priority my reading indicates that all other tasks should be completed before we go to that function, but that's not what I see happening. What I think I should now see: Step 1. Click Button. Step 2. Create subwindow with label. Step 3. Show subwindow and label. Now we're done with all other pending tasks so lets do the lowest priority task, and sleep for 3 seconds. This isn't happening that way; we appear to be sleeping before the rest of the job is done even though the sleep is the lowest priority. I see my window every time but the label only occasionally appears on the first click and it never appears on the second or subsequent click. So, once again, what's wrong with the way that I'm doing this? Even though the sleep is long and will lock up the program for the specified period, I think it should still finish drawing the window and the label before it locks up since the sleep is set to such a low priority. I suspect that the problem is still the same one that I was seeing with my original test.c program as I think the while "(g_main_context_iteration(NULL, FALSE));" that I was using before is supposed to do much the same thing as I'm doing now, i.e process all pending events before sleeping. Previously, I was telling the program to process all pending events and then sleep. Now I'm telling the program to sleep after processing all higher-priority events and, since all of the other events are higher priority, it amounts to exactly the same thing. So I still have the same question and I'm still not understanding what's actually going wrong here. Could someone take me by the hand and tell me that "this line here is wrong because..." I'm sorry to seem so dense about this. -- MELVILLE THEATRE ~ Real D 3D Digital Cinema ~ www.melvilletheatre.com www.creekfm.com - FIFTY THOUSAND WATTS of POW WOW POWER!
Attachment:
test2.c
Description: Text document