TICKIT_WINDOW_REF(3)

πŸ’– TICKIT_WINDOW_REF πŸ’–

okay so bestie, welcome to page 3 of the Library Functions Manual β€” yes, TICKIT_WINDOW_REF(3), the one about adjusting the refcount of a window. refcounting, the little number that decides whether your window lives or dies. no pressure or anything 🫢


✨ NAME ✨

tickit_window_ref, tickit_window_unref β€” adjust the refcount of a window


🌸 SYNOPSIS 🌸

#include <tickit.h>

TickitWindow *tickit_window_ref(TickitWindow *win);
void tickit_window_unref(TickitWindow *win);

Link with -ltickit.

not me reminding you to link the library. don't forget -ltickit or nothing works and you'll be sad 😭

πŸ¦‹ DESCRIPTION πŸ¦‹

tickit_window_ref() increments the stored refcount of the given window instance by one. and the cute part? it hands you back the pointer argument itself, so it's perfect for chaining. like, literally gives you back what you gave it. iconic behaviour πŸ’…

tickit_window_unref() decrements the stored refcount of the given window instance by one. if that refcount drops all the way down to zero, the instance is destroyed. gone. ghosted. πŸ‘‘

and when it goes? it will release any resources controlled by it, and unbind all the bound event handlers, which means handlers get invoked with the TICKIT_EV_DESTROY flag if appropriate. so yeah, your handlers get one last text message before the window leaves the group chat πŸ’€


⭐ RETURN VALUE ⭐

  • tickit_window_ref() returns a window instance pointer.
  • tickit_window_unref() returns no value.

🌈 SEE ALSO 🌈


and that's the whole page, bestie!! thanks for reading TICKIT_WINDOW_REF(3) from the Library Functions Manual β€” go forth, ref responsibly, and remember: whoever holds the refcount holds the power πŸŽ€βœ¨