Re: Progress Bar



I am attempting to utilize a progress bar on initialization of my app.
On first use of the app I want to run slocate -u and would like the
progress bar to reflect the process. Any pointers to how I define file
size for the progress bar?

As I recall the gtk_progress_bar_update() function wants an input from 0.0
to 1.0.

So what I would just use stat(file, &stat_buf) to get the size
with stat_buf.st_size. Then as I load the file increment the bytes read
divided by the stat_buf.st_size.  Remember to cast them as (gfloat) or
(gdouble) during your calculation and also make sure that stat_buf.st_size
is not 0.

Was there something specific you had in mind?

--
Sincerely,                  ,"-_                         \|/
-Capt. Taura M.             ,   O=__                    --X--
..__                         ,_JNMNNEO=_                 /|\
OMNOUMmnne.                  {OMMNNNEEEEOO=_
UOOOBIOOOEOMMn.               'LONMMMMNNEEEOOO=.__..,,..
UUOOEUUOOOOOOOObe              '"=OMMMMWNEEEOOOOO,"=OEEEOO=,._
OOUUUIEEIOONNOIUbe.                "7OMMMMNNNNNWWEEEEOOOOOO"   "'.
EEBNNMMMNWNWWEEIMMNe.             __  7EMMMNNNNNWWWEEEEEEEOO.     " .
NNMMMMWWWMMMWEINMMMNn            "=BBEEEEMMMMMMMMNNNWWWEEOOOOO=._     .
                  http://furry.ao.net/~learfox/





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