Hi,

Below is a small app that reproduces the Gtk/delay problem.  If you
comment out "use Gtk", as I've done, 'go2' gets called after one second
and 'go' after 10, as you'd expect.  However, if you uncomment "use
Gtk", the first 'go2' takes 10 seconds to get hit.

Does anyone know anything about the Gtk event loop, or how POE interacts
with it, that could explain this behavior?

This has been tested on two Redhat Linux 7.1 systems.

Thanks,
Dan

use strict;
#use Gtk;
use Time::HiRes;

use POE;

new POE::Session (
    _start => \&start,
    go => \&go,
    go2 => \&go2,
);
$poe_kernel->run();

sub start {
    my $kernel = $_[KERNEL];
    $kernel->delay( 'go', 10 );
    $kernel->delay( 'go2', 1 );
}

sub go {
    print "Hit ", Time::HiRes::time, "\n";
}

sub go2 {
    print "Hit2 ", Time::HiRes::time, "\n";
}

-------- Original Message --------
Subject: problems with $kernel->delay and Gtk
Date: Wed, 15 Aug 2001 16:22:31 -0400
From: Dan McCormick <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]

Hi,

Has anyone had any problems using $kernel->delay and Gtk?  In my
application, setting a delay of one second takes 15 seconds to process. 
But if I take out the "use Gtk" statement, it works fine.  I can't seem
to reproduce the code in a small snippet, so until I whittle it down
further I thought I'd see if anyone else had run into this...

Thanks,
Dan

Reply via email to