Re: help needed with applet.
- From: Paolo Molaro <lupus ximian com>
- To: gtk-perl-list gnome org
- Subject: Re: help needed with applet.
- Date: Wed, 27 Jun 2001 16:59:23 +0200
On 06/26/01 AvA wrote:
[...]
&monitor;
main Gtk;
exit(0);
sub monitor{
        MONITOR:{
                @a = stat("/var/log/httpd/access_log");
                $test = $a[7];
                while(1){
                        @a = stat("/var/log/httpd/access_log");
                        $test2 = $a[7];
                                if ($test2 != $test){
                                $button->children->set_text("changed");
                                redo MONITOR;
                        }
                }
        }
}
monitor() is basically an infinite loop, you want to do a single check
in it and register the function to run every so often with
        Gtk->timeout_add($millisecs, \&monitor);
Note that the function must return 1 if you want it to be called
again.
lupus
-- 
-----------------------------------------------------------------
lupus debian org                                     debian/rules
lupus ximian com                             Monkeys do it better
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]