Gtk::ProgressBar & Gtk::TreeView



When I add date to TreeView I update ProgressBar (set_fraction( new_val )).
But it doesn't update. And when all date were add to TreeView, ProgressBar show 100%.

What I have to do for solve this?

///////////code

//ProgressBar - 0%
double step = 1.0 / data->size();
progress_bar->set_fraction( 0.0 );

for ( iter = data->begin(); iter != data->end(); ++iter )
{
   row = *( base_ptr->append() );
   row[base_table.column_value] = iter->first;
   row[base_table.column_id] = iter->second;
			
   double new_val = progress_bar->get_fraction() + step;
   if( new_val > 1.0 )
      new_val = 1.0;
			
   progress_bar->set_fraction( new_val );
   //ProgressBar - 0%
}

//ProgressBar - 100% Why?!
///////////

Alexander.



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