Re: GTK Progress bar: assistance pls.





Hey Bin Chen[or how do I call you :-)],

First of all, thank you very much for your instant reply.

Let me give a simple pseudo-code explaining my problem. Please see what I
can do with this.

Program Goal: Do work w1 "iterations" number of times, and keep showing
progress of this whole work regularly.

Pseudo code:

for(i=0;i<iterations;i++)
{
    do w1;
    fraction = (i+1)/iterations;
    Update progress bar using this fraction.
}

This is what I coded, and the progress bar never got updated until
fraction was 0.99[that is, the progress bar went from zero to 100 % after
the whole work was done].

As far as the above pseudo-code goes, the progress bar here doesnt have to
understand my logic of estimating progress fraction. It simply has to
update the fraction given to it regularly.


Please help me[again :-)]

Vijay
On Mon, January 7, 2008 12:31 pm, Bin Chen wrote:


å?¨ 2008-01-07ä¸?ç?? 12:21 +0530ï¼?vijayasarathy setsindia netå??é??ï¼?
Hi All,



My name is Vijay, and I have been working with GTK [with glade] for the
 last few months in making an UI for certain programs that we have
implemented.

The programs I am talking about are ones which keep running for hours
together. I want to use a progress bar which will keep showing the
progress of these program from time to time [wanted to have a time out
function which will automatically be invoked every now and then]. I do
this by having a variable called fraction which will be updated with
the proportion of work that has been completed. I write a function which
will keep invoking itself periodically, and inside the function, I want
to read this variable fraction, and update progress bar correspondingly.


Unfortunately, the example that is given in the GTK tutorial for a
progress bar doesnt address this practical need. It is only in the
periodically invoked function that the new value of fraction for the
progress bar is being updated. Hence it is easy in that case to be
updating progress bar.

Can you please let me know how this should be done.


It sounds like you want to update the progress according your
"progress", right?
I think you should define%2

*************************************************************************************
DISCLAIMER 
This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may 
contain confidential and privileged information. 
Any use,distribution,copying or disclosure by any other person is strictly prohibited. If you have received 
this transmission in error please notify SETS immediately either by replying to this e-mail or by telephone 
+91-44-28205655 and then delete this e-mail. The sender does not accept any responsibility for any damage 
which you sustain as a result of software viruses or malicious programs. You should therefore scan 
attachments (if any) prior to opening them. 
************************************************************************************







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