Re: Gtk::ProgressBar & Gtk::TreeView
- From: Bob Caryl <bob fis-cal com>
- To: rope-walker yandex ru
- Cc: gtkmm-list gnome org
- Subject: Re: Gtk::ProgressBar & Gtk::TreeView
- Date: Fri, 01 Sep 2006 06:35:52 -0500
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Your code should look like this:
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 );
while(Gtk::Main::events_pending()) // this allows your
Gtk::Main::iteration(); // GUI to update your
} // progress bar
Hope this helps.
Bob Caryl
Volosatov Alexander wrote:
> 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.
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
iD8DBQFE+BsYuCj6XIbb5UIRArRJAJ44HtW4rriKZMCQFtz/Msj3ahk63gCg1ZAp
93uO7ctgbafs3i7/7bHHTVU=
=9HT0
-----END PGP SIGNATURE-----
begin:vcard
fn:Robert Caryl
n:Caryl;Robert
org:Fiscal Systems, Inc.
adr:;;102 Commerce Circle;Madison;AL;35758;USA
email;internet:bob fis-cal com
title:Senior Software Design Engineer
tel;work:356-772-8920 X108
x-mozilla-html:TRUE
url:http://www.fis-cal.com
version:2.1
end:vcard
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]