1uevent::onidle(n) User events uevent::onidle(n)
2
3
4
5______________________________________________________________________________
6
8 uevent::onidle - Request merging and deferal to idle time
9
11 package require Tcl 8.4
12
13 package require uevent::onidle ?0.1?
14
15 package require logger
16
17 ::uevent::onidle objectName commandprefix
18
19 objectName request
20
21______________________________________________________________________________
22
24 This package provides objects which can merge multiple requestes for an
25 action and execute the action the moment the system (event loop) be‐
26 comes idle. The action to be run is configured during object construc‐
27 tion.
28
30 The package exports a class, uevent::onidle, as specified below.
31
32 ::uevent::onidle objectName commandprefix
33 The command creates a new onidle object with an associated
34 global Tcl command whose name is objectName. This command may
35 be used to invoke various operations on the object.
36
37 The commandprefix is the action to perform when the event loop
38 is idle and the user asked for it using the method request (See
39 below).
40
41 The object commands created by the class commands above have the form:
42
43 objectName request
44 This method requests the execution of the command prefix speci‐
45 fied during the construction of objectName the next time the
46 event loop is idle. Multiple requests are merged and cause only
47 one execution of the command prefix.
48
50 Examples of this type of deferal are buried in the (C-level) implemen‐
51 tations all the Tk widgets, defering geometry calculations and window
52 redraw activity in this manner.
53
55 This document, and the package it describes, will undoubtedly contain
56 bugs and other problems. Please report such in the category uevent of
57 the Tcllib Trackers [http://core.tcl.tk/tcllib/reportlist]. Please
58 also report any ideas for enhancements you may have for either package
59 and/or documentation.
60
61 When proposing code changes, please provide unified diffs, i.e the out‐
62 put of diff -u.
63
64 Note further that attachments are strongly preferred over inlined
65 patches. Attachments can be made by going to the Edit form of the
66 ticket immediately after its creation, and then using the left-most
67 button in the secondary navigation bar.
68
70 callback, deferal, event, idle, merge, on-idle
71
73 Copyright (c) 2008 Andreas Kupries <andreas_kupries@users.sourceforge.net>
74
75
76
77
78tcllib 0.1 uevent::onidle(n)