Re: Why doesn't my label show up in the window



On Sun, 26 Aug 2012 17:36:01 +0700
Ardhan Madras wrote:

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.

What you are saying, then, is that contrary to (my understanding of) the
documentation, "while (g_main_context_iteration (NULL, FALSE));" doesn't
actually update the screen to account for all pending events?

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

It's actually not that obvious to me.  What is gtk_events_pending actually for,
if not to account for pending events and update the current screen?

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.

That was just the shortest example I could think of to demonstrate how stuff
is missing. I'll post the actual program so you can see what I'm really doing.

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?".

I have posted a complete copy of the program as it exists right now here so
you can see what I'm trying to do:

http://www.melvilletheatre.com/listwrangler.c.bz2

The objective of the program is to maintain an email mailing list for my
theatre.   I have a webpage here
http://www.melvilletheatre.com/mailinglist.html where interested people can
sign up to receive an email from me every time I have a new movie booked.  I
wrote a program a few years ago using ncurses to manage the mailing list and
send out the email and now that I want to learn to use GTK I decided to rewrite
that mailing list program as a learning project.

The program uses http://www.cleancode.org/projects/email to send the actual
emails, so it shells out to that program.

Line 1347:  Initially, I wanted to have a window telling me that the welcome
email was being sent to a new subscriber, and then have it change to tell me
that the last subscription email was being sent.  I discovered that the window
came up blank and then the text telling me that the subscription email was
being sent would show up, so the initial text "sending welcome email" is being
lost.  That's what started me on this road.

Starting around line 970, I also want a progress bar when I do the actual mail
run and send the email to the subscribers.  The progress bar shows up and the
text gets put into it but the bar length never appears (goes above zero) until
it's at 100% when the whole length suddenly appears.  I'm currently testing
this with a "mailing list" of three subscribers (who are all me) and the emails
get sent out as they should and everything else appears to be working except
for the progress bar.

-- 
MELVILLE THEATRE ~ Real D 3D Digital Cinema ~ www.melvilletheatre.com
www.creekfm.com - FIFTY THOUSAND WATTS of POW WOW POWER!



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