help needed with applet.



Hi all,

I am trying to get an applet to work, but somehow it gets stuck...any
comments will be welcome.
Here is the code:
=====================================
#!/usr/bin/perl -w

use Gnome;

init Gnome::Panel::AppletWidget "monitor_applet" ;

$applet = new Gnome::Panel::AppletWidget "monitor_applet";

$button= new Gtk::Button();

$label = new Gtk::Label ("Monitor\nbusy.");
$label->show();

$button->add($label);
$button->show();

$applet ->add($button);
$applet->show();

&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;
                        }
                }
        }
}
=======================

thanks





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]