uevent::onidle(n)
π¦ NAME π¦
uevent::onidle β it's giving request merging and deferral to idle time, bestie β¨
So the manual is uevent::onidle(n), living in the User events section of the manual, and this is me explaining it to you fr fr π
πΈ SYNOPSIS πΈ
package require Tcl 8.5 9
package require uevent::onidle ?0.2?
package require logger
::uevent::onidle objectName commandprefix
objectName request
Like, that's the whole vibe up top. Tcl 8.5 9 β both of them, she's versatile π
β¨ DESCRIPTION β¨
Okay so picture this: this package hands you objects that can merge a bunch of requests for one single action, and then run that action the moment the system β aka the event loop β goes idle π«Ά
The action that's gonna get run? You set that up when you construct the object. That's it, that's the whole thing. No cap.
π API π
The package exports one class, uevent::onidle, and here's exactly how she works:
::uevent::onidle objectName commandprefixβ this command makes a brand new onidle object, and it comes with an associated global Tcl command whose name isobjectName. You use that command to poke at the object and do various operations on it. As forcommandprefix? That's the action to perform when the event loop is idle and the user asked for it using therequestmethod (scroll down, it's right there π).
The object commands that the class commands above create look like this:
objectName requestβ this method requests the execution of the command prefix you specified back when you constructedobjectName, and it happens the next time the event loop is idle. And here's the slay part: multiple requests get merged, so the command prefix only runs once. One execution. Periodt π
π EXAMPLES π
Real examples of this exact type of deferral are buried in the (C-level) implementations of all the Tk widgets β they're out here deferring geometry calculations and window redraw activity in this manner. Icons, honestly π
π BUGS, IDEAS, FEEDBACK π
Not to be dramatic but this document, and the package it describes, will undoubtedly contain bugs and other problems. It's fine. It's fine!! π Please report them in the category uevent of the Tcllib Trackers here: [http://core.tcl.tk/tcllib/reportlist]. And while you're there, please also drop any ideas for enhancements you might have for either the package and/or the documentation. We want them, fr fr π
When you're proposing code changes, please provide unified diffs, i.e. the output of diff -u. That's the format. That's the one.
Also note: attachments are strongly preferred over inlined patches. You make an attachment by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar. Iykyk π
β KEYWORDS β
callback, deferal, event, idle, merge, on-idle
π COPYRIGHT π
Copyright (c) 2008 Andreas Kupries <andreas_kupries@users.sourceforge.net>
And that's the whole page, bestie β brought to you by tcllib, version 0.2, and this page is uevent::onidle(n) in the User events manual. Go merge some requests, you absolute main character π
π¦π
π¦ where this page comes from
- fedora 43: tcllib 2.0-3.fc43 Β· TCL
- fedora 44: tcllib 2.0-4.fc44 Β· TCL
- nixos 26.05: tcllib 2.0
- nixpkgs unstable: tcllib 2.0
- Copyright (c) 2008 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms