RE: GtkProgressBar && RE: updating a progress bar in a loop




On 05-Mar-98 Sergei Naumov wrote:
> I am trying to use progress bar when doing a MySQL query. The
> question I
> have is how do I update the state of the progress bar if everything
> is
> happening INSIDE mysql_query()?


On 05-Mar-98 Chris Black wrote:
> I run gtk_init, create the progress bar, add a timeout that starts
> my 
> loop, within the loop I call gtk_progress_bar_update but the
> display doesn't 
> seem to change. 

Drawing updates usually only happen when you are in gtk_main. You can
force them, however using something like:

while (gtk_events_pending())
        gtk_main_iteration();

inside you're respective functions that change the progress bar.

(I seem to remember seeing something that updated a specific widget,
but can't find it now - but the above should do the trick).

--
E-Mail: Tony Gale <gale@daedalus.dera.gov.uk>
I object to intellect without discipline;  I object to power without
constructive purpose.
                -- Spock, "The Squire of Gothos", stardate 2124.5

The views expressed above are entirely those of the writer
and do not represent the views, policy or understanding of
any other person or official body.



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