Re: more events pending....
| From: | firepages.com.au | Date: | Thu, 23 May 2002 19:17:26 +0000 |
| Subject: | Re: more events pending.... | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-2040@lists.php.net to get a copy of this message | ||
Hi, the start_ticker() && get_bytes() functions work fine.(I got them from
this list) i.e. if I remove the call to fget(etc) which starts the ftp
download then they work fine and echo the (now static) filesize of the file
once per second as required, but as soon as the call to fget(etc is made and
the ftp download begins then the app pretty much freezes until the download
is complete.
I tried the events_pending in the ftp class itself, and that got me one more
loop of the get_bytes() but only one.
Regards
Simon Wheeler
firepages.
----- Original Message -----
From: "Rich Payne" <rdp@talisman.mv.com>
To: "firepages.com.au" <fire@firepages.com.au>
Cc: <php-gtk-general@lists.php.net>
Sent: Friday, May 24, 2002 2:45 AM
Subject: Re: [PHP-GTK] more events pending....
>
>
> I don't know about adding a timeout that calls the same function it was
> started from. Don't know if that's allowed. Wouldn't it be easier just to
> call start_ticker from a Gtk::timeout_add out side of the function and
> just return true ?
>
> --rdp
>
>
> On Fri, 24 May 2002, firepages.com.au wrote:
>
> > Hi yet again !
> >
> > imagine a script which downloads a file via FTP... , I am
ftp_fget()'ting
> > the file so I can check the progress of the download simply by checking
the
> > filesize of the file downloaded so far, this all works I can 'see' the
file
> > growing, I can check the filesize, but not in a loop?
> >
> > I want to be able to report (via status bar or whatever) the progress of
the
> > download so I hoped that the loop in start_ticker() & get_bytes() (which
> > worked fine as a clock) would allow me to update something or other,
however
> > whilst the start_ticker() runs once and reports the initial filesize
then
> > nothing else happens until the download completes , I have tried
> > event_pending in all sorts of weird and wonderful places, with so far
little
> > joy, any pointers greatly appreciated.
> >
> > function
> >
tes(){
> > $this=@filesize('c:/gtkdev/gtkdev.zip');
> > echo $this."bytes \n";
> > }
> > function start_ticker(){
> > get_bytes();
> > Gtk::timeout_add(1000, 'start_ticker');
> > }
> >
> > / /there is a window and stuff here//
> >
> > /* this fires up the ftp class & returns the filesize of the file I want to download*/
> > $f=new ftp('www.firepages.org', '', '');
> > $thissize = $f->size('public_html/public/gtkdev.zip');
> >
> > /*hopefully start the loop that echos the current download -
> > I have tried this before and after the events_pending*/
> > start_ticker();
> >
> > while (gtk::events_pending())
> > gtk::main_iteration();
> >
> > /*start downloading the file*/
> > $f->fget('public_html/public/gtkdev.zip', 'c:/gtkdev/gtkdev.zip');
> > /*when we have the file destroy the ftp object & connection*/
> > $f->nuke();
> >
> > gtk::main();
> >
> >
> >
> > Regards,
> > Simon Wheeler.
> > firepages
> >
> >
> >
> >
> >
>
> --
> Rich Payne
> http://talisman.mv.com
>
>
>
>