Re: help needed with applet.



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]