Re: Simple Progress Bars...



Hi Chris!

Something like this should help. Everything else is covered in the tutorial. Activity mode is the thing you're looking for.

to build:

  progressbar = gtk_progress_bar_new ();
  gtk_widget_show (progressbar);
 // the following depends on your interface - therefore commented
 // gtk_box_pack_start (GTK_BOX (hbox1), progressbar, FALSE, FALSE, 0);
 // gtk_widget_set_usize (progressbar, 100, -2);
  gtk_progress_set_activity_mode (GTK_PROGRESS (progressbar), TRUE);


and update:

{
  ... your stuff ...
  gtk_progress_set_value (GTK_PROGRESS (progressbar), progress);
  progress = (progress+1) % 100;
}


I hope that helps ...
Stefan


Chris Elston wrote:

Hey, quick question.  I want to set up a simple progress bar w/ GTK that
acts similar to the progress bar for GNapster.  IE, one that just goes
back and forth w/ no real regard to actual progress, just to show that
some action is happening.  I also want to set it up so that the progress
bar would have a sort of "on/off" functionality since it really doesn't
have to measure a percentage of progress.  Either a brief description or
some example code would be a big help.  Thanks.







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