XtAppAddBlockHook(3)

✨ XtAppAddBlockHook β€” the block hook registration situation ✨

okay so bestie, this is a page from the XT FUNCTIONS corner of the X Toolkit Intrinsics (that's libXt, the C Language Interface one, you know the vibe πŸ’…). We're talking about block hooks β€” lil' procedures that get pinged right when the Intrinsics are about to go take a nap waiting for input. Two functions live here: XtAppAddBlockHook and XtRemoveBlockHook. Let's get into it 🫢


🌸 NAME 🌸

XtAppAddBlockHook, XtRemoveBlockHook β€” register a block hook procedure ✨


πŸŽ€ SYNTAX πŸŽ€

#include <X11/Intrinsic.h>

XtBlockHookId XtAppAddBlockHook(XtAppContext app_context,
       XtBlockHookProc proc, XtPointer client_data);

void XtRemoveBlockHook(XtBlockHookId id);

πŸ’– ARGUMENTS πŸ’–

  • app_context β€” the application context. Specifies it. That's the whole job, and she does it flawlessly πŸ‘‘
  • proc β€” the block hook procedure. This is the function that's gonna get called, bestie.
  • num_args β€” the application-specific data to be passed to the block hook.
not me noticing num_args is listed down here but does not appear in the synopsis above πŸ™ˆ that's just how the page is, i'm reporting the facts, no cap.

πŸ¦‹ DESCRIPTION πŸ¦‹

XtAppAddBlockHook registers the specified procedure and hands you back an identifier for it. And then? The hook gets called at any time in the future whenever the Intrinsics are about to block pending some input. like, she's on standby, waiting for that moment, main character energy fr fr πŸ’«

Block hook procedures are removed automatically, and the XtBlockHookId is destroyed, when the application context they were added in is destroyed. so you don't have to clean up after yourself β€” the app context does it for you, iconic behavior honestly 🌈

XtRemoveBlockHook removes the specified block hook procedure from the list in which it was registered. manual removal, for when you just can't wait for the context to be destroyed πŸ’…


🌟 SEE ALSO 🌟

  • X Toolkit Intrinsics - C Language Interface
  • Xlib - C Language X Interface

and that's the whole page, bestie, we ate and left no crumbs πŸ“ this was brought to you by X Version 11 and libXt 1.3.1 β€” go forth and hook your blocks, mwah πŸ’œπŸ§š

πŸ“¦ where this page comes from