set_cursor_dimensions(3)

πŸ“¦ version 1.6, in fedora 43, fedora 44

πŸ’– set_cursor_dimensions(3) πŸ’–

okay bestie so we're in the gstream manual and today's main character is set_cursor_dimensions β€” literally the glow-up your cursor has been waiting for πŸŽ€


✨ NAME ✨

set_cursor_dimensions β€” she sets the cursor dimensions, that's it, that's the whole job πŸ’…


🌸 SYNOPSIS 🌸

#include <gstream.h>

void set_cursor_dimensions(int iw, int ih, int ow, int oh);

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea: this function sets your cursor dimensions to IW x IH when you're in insert mode, and OW x OH when you're in overwrite mode. The standard cursors do respond to this, no cap β€” but ngl, it's mostly meant to be used with your own custom cursor drawers. like, that's the whole vibe. 🫢

Before you go requesting any inputs with your custom cursor drawer, you should call this function with the appropriate values. fr fr, do it first.

Wanna set the size of the character underneath the cursor dynamically? pass gbuf::DYNAMIC_CURSOR_SIZE and it handles the rest:

  • if the cursor is at the end of the line, it gets the width of a space ' '
  • else, it gets the size of the character under it

so it just knows. iconic behaviour honestly ✨


πŸŽ€ the example (she's giving vertical line, then BITMAP) πŸŽ€

Say we've created a nice cursor drawer where, for the insert cursor, it's one pixel wide and as tall as the characters β€” in other words, a vertical line β€” but for the overwrite cursor it's a BITMAP with the dimensions 8x10. Then this is what you'd do:

gs.set_cursor_dimensions(1, gbuf::DYNAMIC_CURSOR_SIZE, 8, 10);

slay. πŸ¦‹


πŸ’€ IMPORTANT, bestie, do NOT skip this part β€” it is important that you remember to call this function when you're using custom cursor drawers. Else the inputter doesn't know how much of the background below the cursor to save and recover. and then everything is chaos. not the cute kind. 😭

The default dimensions are the dimensions that are suited for the default cursor. simple as that 🌈


πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page, periodt πŸ’œ this was brought to you by gstream, version 1.6 β€” go forth and dimension your cursors, you've got this πŸŽ€βœ¨πŸ’–

πŸ“¦ where this page comes from