Hi,

sleep() block the mainloop or gtk_main() which GTK+'s most widgets are
updated in queue, also remember that gtk_main() (usually) runs in main
thread. You may got inconsistency which the label sometimes shown up
or not because most of time the update (in your case: the label) are
still not drawn when you call sleep() and block the main thread. Then
your program wake up from sleep() and complete any pending event: draw
the label, but unfortunately you will not noticed that the label has
been shown up because it destroy it's parent widget and just return.

And obviously, gtk_events_pending() are not intended to work with your case.

That's ugly to call sleep() between gtk_main(), because you will mess
with GUI interaction (unresponsive) , widget update, event signal's
etc. So avoid using it.

> I have read up on the use of timeouts as suggested by Ardhan Madras and while
> it appears to be an approach that could be made to work in my situation, I 
> don't
> see why it should be necessary to work off of  a timer when I'm just counting
> records.
So I may have misunderstood your question, what I got is: you tried to
create another window and destroy it after a few of seconds. that's
it? Could you tell me "what record you are trying to count?".

And what I was trying to suggest you is not about using a timer. It's
about how GTK+ works.

Regards.


On Sun, Aug 26, 2012 at 12:31 PM, Frank Cox <thea...@melvilletheatre.com> wrote:
> On Sat, 25 Aug 2012 16:18:20 -0600
> Frank Cox wrote:
>
> I have modified my little test program so it will provide a visual cue for 
> each
> pending event.  I have attached the modification.
>
> I get three pending events every time I press the OK button.  The subwindow
> always appears.  The label sometimes appears on the first button press, but
> never on any subsequent button press.  But in all cases, there are three
> pending events, never more and never less, regardless of whether the label
> appears or not.
>
> What is going on here?
>
> I have also been experimenting with a progress bar and have a similar
> situation.  It only updates the bar length to 100% after the entire job is 
> over,
> interim updates never show up and the bar stays at zero, but interestingly
> enough text superimposed on the bar with gtk_progress_bar_set_text() shows up
> as it should be.  So I get the text updated but not the bar length.  Which
> bothers me because, again, I would think I should get either both the bar
> length and the text updated, or neither.
>
> I have read up on the use of timeouts as suggested by Ardhan Madras and while
> it appears to be an approach that could be made to work in my situation, I 
> don't
> see why it should be necessary to work off of  a timer when I'm just counting
> records.
>
> --
> MELVILLE THEATRE ~ Real D 3D Digital Cinema ~ www.melvilletheatre.com
> www.creekfm.com - FIFTY THOUSAND WATTS of POW WOW POWER!
>
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to