TICKIT_WINDOW_FLUSH(3)

πŸ’– TICKIT_WINDOW_FLUSH πŸ’–

okay bestie, so this is a page from the Library Functions Manual β€” it's tickit_window_flush(3), and yes we're gonna get into it πŸ’…


✨ NAME ✨

tickit_window_flush β€” invoke pending events on the window hierarchy πŸ¦‹


✨ SYNOPSIS ✨

#include <tickit.h>

void tickit_window_flush(TickitWindow *win);

Link with -ltickit.


🚨 DEPRECATED 🚨

ngl bestie, this one is deprecated and should not be used in new programs. like, at all. πŸ™ˆ

Instead, get the root window from the toplevel Tickit instance by calling tickit_get_rootwin(3), and its pending events will automatically be managed by the toplevel instance's tickit_run(3) function. slay, no manual flushing required πŸ’…


🌸 DESCRIPTION 🌸

tickit_window_flush() causes any pending activity in the window hierarchy to be performed. it's giving "get your life together and do the thing" energy ✨

here's the order it does stuff in, because order matters bestie:

  1. First, it makes any window ordering changes that have been queued by tickit_window_raise(3) and tickit_window_lower(3).
  2. Then, it fires any TICKIT_EV_EXPOSE events to render newly-exposed areas.
  3. Finally, it resets the terminal cursor to the state required by whichever window has input focus. πŸ‘‘
heads up: this function must be invoked on the root window instance. not a subwindow, the root. periodt.

An application working at the window level would typically use this function in conjunction with input event waiting, to drive the main loop of the core logic. such a loop may look like:

while(1) {
  tickit_window_flush(rootwin);
  tickit_term_input_wait_msec(term, -1);
}

There is no adverse effect of calling this function when there are no pending events on the window instance. so go ahead, spam it, it's fine πŸ’–

An application that makes use of multiple root windows across multiple terminal instances in a multi-head setup can safely invoke it on all the root windows at once. multi-head besties, this one's for you 🌈


✨ RETURN VALUE ✨

tickit_window_flush() returns no value. nothing. void. it's giving mystery, but there's no mystery, it just doesn't return anything πŸŽ€


πŸ‘€ SEE ALSO πŸ‘€


and that's the whole page bestie!! this one came from the Library Functions Manual, and the footer says TICKIT_WINDOW_FLUSH(3) β€” ily, go write something cute πŸ’œβœ¨