TICKIT_WINDOW_SCROLL(3)

✨ TICKIT_WINDOW_SCROLL β€” bestie, let's scroll ✨

okay so real quick: this is the manual for tickit_window_scroll and tickit_window_scrollrect, aka the two functions that make the area of a window go scroll scroll scroll πŸ’… and there's a bonus third one hiding in there too, tickit_window_scroll_with_children, which we'll get to. stay with me, it's giving very much "ask the terminal nicely and hope it says yes" energy.


🌸 NAME 🌸

tickit_window_scroll, tickit_window_scrollrect β€” scroll the area of a window πŸŒ€


πŸŽ€ SYNOPSIS πŸŽ€

#include <tickit.h>

bool tickit_window_scroll(TickitWindow *win, int downward, int rightward);
bool tickit_window_scrollrect(TickitWindow *win, const TickitRect *rect,
         int downward, int rightward, TickitPen *pen);

bool tickit_window_scroll_with_children(TickitWindow *win,
         int downward, int rightward);

Link with -ltickit. 🫢 don't forget, bestie, or the linker will simply not know you.


πŸ’– DESCRIPTION πŸ’–

πŸ¦‹ tickit_window_scroll()

tickit_window_scroll() is basically you going "hey terminal, scroll the contents of the area that matches this window's visible region (or regions, plural, yes, there can be more than one πŸ‘€) by this much." And it's smart about it β€” it takes into account all the visibility drama of the window, like:

  • being obscured by siblings 😀
  • being obscured by siblings of ancestors (yeah, the family tree is messy)
  • child windows
  • whether the window itself or any parent is hidden πŸ™ˆ

It returns true if it actually managed to do the scrolling, or false if not. no cap.

🧚 tickit_window_scrollrect()

tickit_window_scrollrect() does the same kinda thing but for the area corresponding to the rect you hand it, inside the window. Otherwise it works analogously to tickit_window_scroll(). ✨

And here's the cute extra: if the pen argument is non-NULL, it gets applied to the terminal before any erase operations inside the window happen β€” which means you can set a different background colour. iconic. πŸ‘‘

πŸ‘‘ tickit_window_scroll_with_children()

tickit_window_scroll_with_children() is similar again, except β€” plot twist β€” it does not consider obscuring regions caused by child windows. Only siblings, and siblings of ancestors. periodt.

It's intended for scrolling a container of windows, which will move all the sub-windows too. 🌈

⚠️ important caveat bestie, do not skip this: this function does not actually move the child windows. it just requests a scrolling operation on the underlying terminal. that's it. that's the whole thing. πŸ’€

⭐ RETURN VALUE ⭐

These functions all return a boolean. true/false, yes/no, slay/not slay. 🫢


🌟 SEE ALSO 🌟


and that's the whole page, bestie πŸ’œ this was the TICKIT_WINDOW_SCROLL(3) manual page, coming to you from the Library Functions Manual β€” the page header and footer literally just say TICKIT_WINDOW_SCROLL(3) on both ends, so now you know, iykyk. go forth and scroll responsibly. πŸŽ€βœ¨