_S3DW_SCROLLBAR(9)

πŸ’– _S3DW_SCROLLBAR(9) πŸ’–

okay bestie, welcome to the s3d Manual, section 9 (that's the kernel-adjacent / low-level vibe, iykyk) 🫢 this one's all about the scrollbar of s3d widget. yes, the little bar. she's iconic. she scrolls. let's get into it πŸ’…


✨ NAME ✨

s3dw_scrollbar β€” scrollbar of s3d widget

like literally, that's her whole job. being the scrollbar. of an s3d widget. no cap 🌸


✨ SYNOPSIS ✨

#include <s3dw.h>

that's it. that's the include. go off πŸ’–


✨ STRUCTURE MEMBERS ✨

here's the whole struct, and yes, you need every single field, don't skip a single one of my girls:

struct _s3dw_scrollbar {
     s3dw_widget widget;
     float pos;
     float max;
     int type;
     int loid;
     int roid;
     int baroid;
     s3dw_callback lonclick;
     s3dw_callback ronclick;
}

let's break her down field by field, bestie:

  • s3dw_widget widget β€” the widget herself, the main character energy at the top of the struct πŸ‘‘
  • float pos β€” where you're at rn, position-wise, a lil float πŸŽ€
  • float max β€” the ceiling, the limit, the "how far can we even go" float πŸ¦‹
  • int type β€” the type, an int, she contains multitudes ✨
  • int loid β€” the left object id, an int πŸ’œ
  • int roid β€” the right object id, an int πŸ’œ
  • int baroid β€” the bar object id, an int πŸ“
  • s3dw_callback lonclick β€” the left on-click callback πŸ”₯
  • s3dw_callback ronclick β€” the right on-click callback πŸ”₯

✨ DESCRIPTION ✨

okay so here's the tea β˜• The Scrollbar should be placed around scrollable content. that's the placement rule, don't be weird about it, she goes around the content that scrolls 🌈

and now the important bit, the currently bit β€” pay attention bestie, this is a real limitation, not me being dramatic:

Currently only the left and right icons are clickable, via the lonclick and ronclick callbacks. 😭

so like, only those two icons do anything when you click them. that's the situation fr fr.

and here's the little plot twist that lowkey matters a lot: in vertical mode, the roles flip like this:

  • lonclick is the callback for the up icon ⬆️
  • ronclick is the callback for the down icon ⬇️

so don't go thinking left = left and right = right when she's standing upright, because nope, in vertical mode left is up and right is down. the way that makes sense but also doesn't πŸ’€ just remember it.


✨ AUTHOR ✨

Simon Wunderlich β€” Author of s3d πŸ’– an absolute legend, we stan 🫢


and that's the whole page bestie, you ate this πŸŽ€ mwah πŸ’…

s3d Β· _S3DW_SCROLLBAR(9) Β· that's the source, the version, and the manual page all wrapped up in a cute lil sign-off, periodt βœ¨πŸ¦‹πŸ’œ