[Newbism][Win32] Progress bar not updating in 'real time'
| From: | David Ramalho | Date: | Thu, 10 Jan 2002 17:27:14 +0000 |
| Subject: | [Newbism][Win32] Progress bar not updating in 'real time' | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-979@lists.php.net to get a copy of this message | ||
Hi guys! Well, I have something against asking without
exhausting every solution first, but hey :) I'm gonna ask anyway.
I have a piece of code that extracts information from a database
and populates a CList with it. For the fun of it, I've put a progress
bar that was supposed to show the.. progress (go figure :) ) . Anyway, I
take the data from the DB, see how many rows there are, do 1+1 math and
use the Update() method from the ProgressBar with the respective
percentage. Thing is he only shows the last value i.e. 100%. I guess the
API is just too slow to be able to redraw the Widget like I want, but
maybe I'm missing something :) . I've tried a few things, but nothing
useful. I'll put a example code below, for whatever good it might bring
:)
$Lst [GtkClist]
...
$Common["Prd_PrgBar1"]->update(0); // Clear it
$query = mysql_query("select something from somewere");
$Lst->clear();
$Lst->freeze();
$NumRows = mysql_num_rows($query);
$Cont = 1;
while ( $row = mysql_fetch_row( $query ) )
{
$Lst->append( $row ) );
$Common["Prd_PrgBar1"]->update( ($Cont/$NumRows) );
++$Cont;
}
$Lst->thaw();
Right, If anyone can help me, I would be very appreciated :)
David Ramalho [Songo]