TICKIT_WINDOW_NEW_ROOT(3)

πŸ’– TICKIT_WINDOW_NEW_ROOT(3) πŸ’–

okay bestie, welcome to the TICKIT_WINDOW_NEW_ROOT page of the Library Functions Manual ✨ this one's short but it's important, and also it's kinda deprecated so listen up 🫢


🌸 NAME 🌸

tickit_window_new_root β€” create a new toplevel root window πŸ‘‘


✨ SYNOPSIS ✨

#include <tickit.h>

TickitWindow *tickit_window_new_root(TickitTerm *term);

Link with -ltickit.


πŸ’€ DEPRECATED πŸ’€

no cap, this function is deprecated and should not be used in new programs. like, at all. it's giving legacy πŸ’…

Instead, bestie, you get the root window from the toplevel Tickit instance by calling tickit_get_rootwin(3). that's the move. that's the vibe. periodt.


πŸ¦‹ DESCRIPTION πŸ¦‹

tickit_window_new_root() creates a brand new toplevel TickitWindow instance, and its whole job is to represent the drawing area on the given terminal instance. the terminal instance is stored by the window itself, and it's used for flushing the TickitRenderBuffer to when expose events occur. also β€” and this is the real tea β€” the root window will increase the reference count of its backing terminal by one, and that reference gets dropped when the window is destroyed. refcount go up, refcount go down πŸ“ˆπŸ“‰

The root window behaves similar to other windows within the application, with the following differences:

  • Its position remains fixed at zero, and should not be set by the application. like, don't touch it, it's not yours πŸ™ˆ
  • Its size is managed automatically by observing resize events from the underlying terminal instance, and should not be set by the application. she manages herself, honestly iconic ✨
  • It is initially fully-damaged after construction, and will have a pending expose event waiting to occur. it's literally already in its expose era before you even do anything 😭

πŸŽ€ RETURN VALUE πŸŽ€

If successful, tickit_window_new_root() returns a pointer to the new instance. that's it. that's the whole return value. slay 🫢


πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page, bestie πŸ’œ it's from the Library Functions Manual, the footer just echoes TICKIT_WINDOW_NEW_ROOT(3) right back at you like a mirror selfie, and yeah β€” go use tickit_get_rootwin(3) instead, iykyk 🧚✨