A simple Time slider, using a progress bar.

We use the gtk_timeout_add() function to add 
timeouts. Timeouts are functions that get executed
as and when the timer expires. We can set the function
to be called again and again if we return value TRUE
from the callback, else if we return FALSE the timeout
function is killed.

The way to set the progress bar is using these calls.

Create a progress bar.
Set format strings. These follow printf syntaxes.
 Using %% we can get a % and using %V we can have the
 absolute value of the scale, %P gives the percentage
 scale etc.

Set the value of the scale using configure;its max & min

We also set the orientation, it can be Top to bottom,
left to right, and vice versa.

Also enble the text showing property to be true.

  gtk_progress_set_format_string(GTK_PROGRESS(x),"%V %%"); 

We can update the progress bar like this.
Get its value, and after an event it over, we
set its value to give the user some feedback of
the progressbar's status.


By default the progressbar gets values from 0 to 100.

Suggested uses of the slider are for an application Launcher, 
like the one we most often encounter with setup programs,
and application loading windows like the GIMP startup window,
which shows interactively the time left for startup and
gives feedback on the type of application plugins being 

see also: adjustable, scrollbar

Last Modified on Sun Jul 3 23:41:40 IST 2005
This is part of the GtkBook project Hosted Here
This code, documents and images are © Muthiah Annamalai
This document is under Creative Commons License given by LICENSE