RE: [PHP-GTK] updating a label text while in upload loop
| From: | Tradebit Service | Date: | Tue, 18 Oct 2005 12:28:11 +0000 |
| Subject: | RE: [PHP-GTK] updating a label text while in upload loop | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-6250@lists.php.net to get a copy of this message | ||
> while(gtk::events_pending())
> gtk::main_iteration();
nghia,
works fine, many thanks... i was confused about the
"while loop in a while loop", looked like a possible hang up...
....
$myfile=fopen($localfilename,"r") or die("not found");
$upload = ftp_nb_fput($conn_id, $myupname, $myfile, FTP_BINARY);
while ($upload == FTP_MOREDATA)
{
// update the status
$statustext->set_text("Destination:".$myupname."\n".ftell($myfile)." /
".$localfilesize);
// Continue upload...
$upload = ftp_nb_continue($conn_id);
while(gtk::events_pending())
gtk::main_iteration();
}
fclose($myfile);
...
uploads quite fast and updates the statustext fine!
cheers,
ralf
http://www.tradebit.com/