NAME
AnyEvent::Impl::Tk - AnyEvent adaptor for Tk
SYNOPSIS
use AnyEvent;
use Tk;
# this module gets loaded automatically as required
DESCRIPTION
This module provides transparent support for AnyEvent. You don't have to do anything to make Tk work with AnyEvent except by loading Tk before creating the first AnyEvent watcher.
Tk is buggy. Tk is extremely buggy. Tk is so unbelievably buggy that for each bug reported and fixed, you get one new bug followed by reintroduction of the old bug in a later revision. I regularly run out of words to describe how bad it really is.
To work around the many, many bugs in Tk that don't get fixed, this adaptor dup()'s all filehandles that get passed into its I/O watchers, so if you register a read and a write watcher for one fh, AnyEvent will create two additional file descriptors (and handles).
This creates a high overhead and is slow, but seems to work around all known bugs in Tk::fileevent on 32 bit architectures (Tk seems to be terminally broken on 64 bit).
To be able to access the Tk event loop, this module creates a main window and withdraws it immediately. This might cause flickering on some platforms, but Tk perversely requires a window to be able to wait for file handle readyness notifications. This window is always created (in this version of AnyEvent) and can be accessed as $AnyEvent::Impl::Tk::mw
.
SEE ALSO
AUTHOR
Marc Lehmann <schmorp@schmorp.de>
http://home.schmorp.de/