Subject: | Tk::fileevent clears all handlers, not just the requested one |
The following program:
#!/usr/bin/perl
use Tk;
open my $fh, "+>/tmp/tktest" or die;
my $mw = new MainWindow;
$mw->fileevent ($fh, readable => "1");
$mw->fileevent ($fh, writable => "2");
warn $mw->fileevent ($fh, "readable");
warn $mw->fileevent ($fh, "writable");
$mw->fileevent ($fh, readable => "");
warn $mw->fileevent ($fh, "readable");
warn $mw->fileevent ($fh, "writable");
Outputs:
Tk::Callback=SCALAR(0xa51950) at /tmp/tk.pl line 11.
Tk::Callback=SCALAR(0x9230c0) at /tmp/tk.pl line 12.
Warning: something's wrong at /tmp/tk.pl line 14.
Warning: something's wrong at /tmp/tk.pl line 15.
i.e. the "writable" handle gets cleared errornously, contrary to documentation, which explicitly states that readavlke and writable event handlers can be deleted seperately.