1AnyEvent::Impl::Tk(3) User Contributed Perl DocumentationAnyEvent::Impl::Tk(3)
2
3
4

NAME

6       AnyEvent::Impl::Tk - AnyEvent adaptor for Tk
7

SYNOPSIS

9          use AnyEvent;
10          use Tk;
11
12          # this module gets loaded automatically as required
13

DESCRIPTION

15       This module provides transparent support for AnyEvent. You don't have
16       to do anything to make Tk work with AnyEvent except by loading Tk
17       before creating the first AnyEvent watcher.
18
19       Tk is buggy. Tk is extremely buggy. Tk is so unbelievably buggy that
20       for each bug reported and fixed, you get one new bug followed by
21       reintroduction of the old bug in a later revision. It is also basically
22       unmaintained: the maintainers are not even interested in improving the
23       situation - reporting bugs is considered rude, and fixing bugs is
24       considered changing holy code, so it's apparently better to leave it
25       broken.
26
27       I regularly run out of words to describe how bad it really is.
28
29       To work around the many, many bugs in Tk that don't get fixed, this
30       adaptor dup()'s all filehandles that get passed into its I/O watchers,
31       so if you register a read and a write watcher for one fh, AnyEvent will
32       create two additional file descriptors (and handles).
33
34       This creates a high overhead and is slow, but seems to work around most
35       known bugs in Tk::fileevent on 32 bit architectures (Tk seems to be
36       terminally broken on 64 bit, do not expect more than 10 or so watchers
37       to work on 64 bit machines).
38
39       Note also that Tk event ids wrap around after 2**32 or so events, which
40       on my machine can happen within less than 12 hours, after which Tk will
41       stomp on random other events and kill them. So don't run Tk programs
42       for more than an hour or so.
43
44       To be able to access the Tk event loop, this module creates a main
45       window and withdraws it immediately. This might cause flickering on
46       some platforms, but Tk perversely requires a window to be able to wait
47       for file handle readyness notifications. This window is always created
48       (in this version of AnyEvent) and can be accessed as
49       $AnyEvent::Impl::Tk::mw.
50

SEE ALSO

52       AnyEvent, Tk.
53

AUTHOR

55        Marc Lehmann <schmorp@schmorp.de>
56        http://home.schmorp.de/
57
58
59
60perl v5.12.1                      2009-08-09             AnyEvent::Impl::Tk(3)
Impressum