TICKIT_WINDOW_NEW(3)

πŸ’– TICKIT_WINDOW_NEW(3) πŸ’–

okay bestie, so this is a page from the Library Functions Manual β€” it's all about tickit_window_new, and honestly? it's giving window-factory energy. let's get into it 🫢


✨ NAME ✨

tickit_window_new β€” create a new sub-window πŸͺŸπŸŒΈ


✨ SYNOPSIS ✨

#include <tickit.h>

TickitWindow *tickit_window_new(TickitWindow *parent, TickitRect rect,
         TickitWindowFlags flags);

Link with -ltickit.


✨ DESCRIPTION ✨

so tickit_window_new() literally makes you a brand new sub-window, and it becomes a child of the parent you hand it. the rect you pass in is its initial geometry, measured relative to its parent. and then flags? that's a bitmask of flags that vibe-check how the child window behaves at the start. no cap πŸ’…

here's the flag lore, one by one:

  • TICKIT_WINDOW_HIDDEN β€” the new child gets created in the hidden state from the jump. no pending expose event happens because of it. whenever you're ready to show it off, call tickit_window_show(3). it's giving mysterious main character who hasn't entered the room yet πŸ™ˆ
  • TICKIT_WINDOW_LOWEST β€” normally the most recently-added child window gets ordered at the top of the list in its parent, which makes it appear front-most on screen. this flag says nope, add it at the bottom of the list instead, so it appears lowest-most. humble. understated. iconic in its own way.
  • TICKIT_WINDOW_ROOT_PARENT β€” the new child window's parent will be the root window of the window tree instead of the window you gave it. and the position gets automatically adjusted so the new window still shows up at the geometry position you gave, relative to the window passed as the parent argument. so it looks like it's where you asked, but the family tree said sike 🌈
  • TICKIT_WINDOW_STEAL_INPUT β€” the new child gets initially set to steal input events; peep tickit_window_set_steal_input(3) for the deets. πŸ‘‘
heads up bestie: this flag is not useful when you combine it with TICKIT_WINDOW_LOWEST, because the input-stealing behaviour only applies while the window is front-most within its parent. so that combo? yeah, it just doesn't hit the same πŸ’€
  • TICKIT_WINDOW_POPUP β€” a convenient shortcut that specifies both TICKIT_WINDOW_ROOT_PARENT and TICKIT_WINDOW_STEAL_INPUT at once. super useful for implementing popup dialog windows, menus, and other such UI behaviours. the popup serve, fr fr πŸ”₯

also, important: the reference count of a newly-constructed window instance will be one. you can bump it up or down with tickit_window_ref(3) and tickit_window_unref(3). the moment its reference count hits zero, it's destroyed. gone. periodt πŸ’€βœ¨


✨ RETURN VALUE ✨

if everything goes well, tickit_window_new() returns a pointer to the new instance. slay πŸŽ€


✨ SEE ALSO ✨


and that's the whole page, bestie!! this came from the Library Functions Manual and the page itself is TICKIT_WINDOW_NEW(3) β€” go build something gorgeous with it πŸ’œπŸ¦‹βœ¨