d_slider_proc(3)

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

πŸ’– d_slider_proc(3) πŸ’–

okay bestie, welcome to the Allegro manual β€” yes, the Allegro game programming library, and yes we're about to talk about sliders. sit down, grab a strawberry πŸ“, this one's cute.


✨ NAME ✨

d_slider_proc β€” it's a dialog procedure that implements a slider control object, and it lives in the Allegro game programming library. that's the whole vibe. 🎚️


🌸 SYNOPSIS 🌸

#include <allegro.h>

int d_slider_proc(int msg, DIALOG *d, int c);

like, that's the signature. no cap. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so. it's a slider control object. main character energy honestly. πŸŽ€

here's the tea: this object holds a value in d2, and that value lives in the range from 0 to d1. periodt. so d1 is your ceiling and d2 is where you're currently at.

now, the orientation? that's a whole vibe check on its own:

  • if h is greater than or equal to w, it displays as a vertical slider πŸ§β€β™€οΈ
  • otherwise, it displays as a horizontal slider πŸ›Œ

the dp field can contain an optional bitmap to use for the slider handle (the lil thing you drag, you know the one) ✨

and dp2 can contain an optional callback function β€” and this one's important, bestie β€” it gets called each time d2 changes. every. single. time. it's giving attentive.

that callback function should have this exact prototype, no improvising:

int function(void *dp3, int d2);

and here's the part where it gets iconic: the d_slider_proc object will return the value of the callback function. yes, the callback's return value is the return value. it's a whole chain. πŸ‘‘

ngl, if you skip the callback, nothing breaks β€” it's optional β€” but then nobody gets notified when d2 moves and honestly that's a little sad. πŸ™ˆ

πŸ”₯ SEE ALSO πŸ”₯

go read those too, iykyk. πŸ“š


and that's a wrap on the sliders, bestie!! this whole page is from Allegro version 4.4.3 β€” slay, iconic, no notes πŸ’œπŸ’–βœ¨πŸ«ΆπŸŽ€πŸ¦‹

πŸ“¦ where this page comes from