Tk_QueueWindowEvent(3)
π Tk_QueueWindowEvent(3) β a Tk Library Procedures moment
ok so before we even start: this page lives in the Tk Library Procedures manual, and it's basically the group chat between your window events and Tcl's event queue. two functions, one whole vibe. let's get into it π«Ά
β¨ NAME β¨
Tk_CollapseMotionEvents, Tk_QueueWindowEvent β add a window event to the Tcl event queue (and control whether motion events get squished together, bestie)
πΈ SYNOPSIS πΈ
#include <tk.h>
int
Tk_CollapseMotionEvents(display, collapse)
Tk_QueueWindowEvent(eventPtr, position)
π ARGUMENTS π
Display *display(in) β the display you're controlling motion-event-collapsing for. like, which screen are we talking about, be specific πint collapse(in) β tells it whether motion events should be collapsed or not. yes/no energy.XEvent *eventPtr(in) β the event you're adding to the queue. highkey important: all the unused fields of the structure gotta be set to zero. not optional, not a suggestion. zero them out fr fr.Tcl_QueuePosition position(in) β where in the queue the new event goes:TCL_QUEUE_TAIL,TCL_QUEUE_HEAD, orTCL_QUEUE_MARK.
π¦ DESCRIPTION π¦
okay so Tk_QueueWindowEvent does the whole thing where it places a window event on Tcl's internal event queue so it can eventually get serviced. the way it works: it creates a Tcl_Event structure, copies the event into that structure, and then calls Tcl_QueueEvent to actually add the event to the queue. and then when the event eventually gets removed from the queue, it's processed just like all window events. iconic, no notes π
now, the motion event lore: when multiple motion events are received for the same window in rapid succession, they are collapsed by default. that's just the default behavior, it's giving efficiency. but you can control this with Tk_CollapseMotionEvents. and here's the cute bit β Tk_CollapseMotionEvents always returns the previous value for collapse behavior on the display. so it's like, "here's your old setting back, bestie, you're welcome" β¨
the position argument to Tk_QueueWindowEvent has the same significance as it does for Tcl_QueueEvent β so if you want the details on that, go read the documentation for Tcl_QueueEvent. iykyk π§
β KEYWORDS β
callback, clock, handler, modal timeout, events
ngl this one's short but it matters β queue those events correctly and zero your unused struct fields, or the vibe check will fail π
made with love for the Tk fam, version 7.5, signed off on Tk_QueueWindowEvent(3) πππ
π¦ where this page comes from
- alpine 3.23: tk9-doc 9.0.3-r0 Β· TCL
- alpine 3.24: tk9-doc 9.0.3-r2 Β· TCL
- fedora 43: tk-devel 1:9.0.2-1.fc43 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 43: tk-devel 1:9.0.2-1.fc43 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 44: tk-devel 1:9.0.2-1.fc44 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 44: tk-devel 1:9.0.2-1.fc44 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- nixos 26.05: tk 9.0.3
- nixpkgs unstable: tk 9.1.0
- Copyright (c) 1995-1996 Sun Microsystems, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms