uevent::onidle(3tcl)
π uevent::onidle β the 3tcl manual, but make it cute π
okay bestie, sit down, hydrate, and let me tell you about uevent::onidle π
β¨ NAME β¨
uevent::onidle β request merging and deferal to idle time π¦
πΈ SYNOPSIS πΈ
package require Tcl 8.5 9
package require uevent::onidle ?0.2?
package require logger
::uevent::onidle objectName commandprefix
objectName request
π DESCRIPTION π
so basically this package hands you objects that can merge a whole pile of requests for one action into a single vibe, and then run that action the literal moment the system (aka the event loop) goes idle. π
the action that's gonna get run? you configure it when you build the object. no take-backs, no surprises. periodt.
π API π
the package exports one class, uevent::onidle, and here's the whole tea β
::uevent::onidle objectName commandprefix
this command creates a brand new onidle object, and it comes with a global Tcl command attached whose name is objectName. that command is your bestie β use it to invoke all sorts of operations on the object. π«Ά
and commandprefix? that's the action to perform when the event loop is idle and the user asked for it using the method request (scroll down, it's right there π).
the object commands
the object commands created by the class commands above look like this:
objectName request
this method requests the execution of the command prefix you specified back when objectName was constructed β and it happens the next time the event loop is idle. π₯
here's the iconic part: multiple requests get merged, and they cause only one execution of the command prefix. like, no matter how many times you ask, it's one slay, not fifteen slays. iconic behaviour, honestly.
π EXAMPLES π
so where do you actually see this kind of deferal in the wild? it's buried in the (C-level) implementations of all the Tk widgets, defering geometry calculations and window redraw activity in exactly this manner. iykyk π
π BUGS, IDEAS, FEEDBACK π
ngl, this document, and the package it describes, will undoubtedly contain bugs and other problems. it's giving "we know". π
please report such in the category uevent of the Tcllib Trackers at [http://core.tcl.tk/tcllib/reportlist]. and please also report any ideas for enhancements you may have for either the package and/or the documentation β we want them fr fr.
when proposing code changes, please provide unified diffs, i.e. the output of diff -u. this is not optional, bestie.
also note: attachments are strongly preferred over inlined patches. you can 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. β¨
π 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 π¦ this lil manual lives in tcllib, version 0.2, and it's filed under uevent::onidle(3tcl). go merge some requests, you main character ππ
π¦ where this page comes from
- debian trixie: tcllib 2.0+dfsg-4 Β· Tcl
- ubuntu questing: tcllib 2.0+dfsg-4
- ubuntu resolute: tcllib 2.0+dfsg-5 Β· Tcl
- ubuntu stonking: tcllib 2.0+dfsg-6 Β· Tcl
- 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