S3DW_HANDLE_CLICK(3)
S3DW_HANDLE_CLICK π (that's section 3 of the s3d manual, bestie)
okay so. you clicked a thing. you want the thing to do something. this is the function that makes the thing do the something. let's go π
β¨ NAME β¨
s3dw_handle_click β handle click on widget π
β¨ SYNOPSIS β¨
#include <s3dw.h>
int s3dw_handle_click(const struct s3d_evt *event);
β¨ DESCRIPTION β¨
so here's the tea, bestie π« β if you want your widgets to actually react to mouseclicks (and omg you do, believe me, you want that, everyone wants that, it's giving essential), you have to call s3dw_handle_click. that's the whole vibe.
you've got two ways to do it and both are iconic, pick your fighter:
- way 1 β just hand it straight to the callback setter and let it be the clickhandler itself. one line, zero drama.
- way 2 β write your own clickhandler function and call
s3dw_handle_clickinside it first, then do your own little extra stuff after. main character energy, you get to add your own sauce π
here's how both look in actual code, no cap:
// way 1:
s3d_set_callback(S3D_EVENT_OBJ_CLICK,s3dw_handle_click);
// way 2:
...
void click(struct s3d_evt *evt)
{
s3dw_handle_click(evt);
....
// your own clickhandler code
...
}
....
s3d_set_callback(S3D_EVENT_OBJ_CLICK,click);
ok important note bestie: if you go with way 2 you still have to call s3dw_handle_click(evt) in there. the function isn't doing magic on its own, it needs the invite to the party. don't skip it and then wonder why your widgets are dead π
and the return type? it's an int. that's the synopsis talking, not me. β¨
β¨ AUTHOR β¨
Simon Wunderlich β Author of s3d π the literal legend who built this whole thing.
that's the page, babes π this little slice of the s3d manual lives under S3DW_HANDLE_CLICK(3) β go forth and make your widgets clickable, you absolute icon π¦πΈ
π¦ where this page comes from
- debian bookworm: s3d-doc 0.2.2.1-5 Β· GPL-2.0-or-later
- debian trixie: s3d-doc 0.2.2.1-7 Β· GPL-2.0-or-later
- ubuntu jammy: s3d-doc 0.2.2.1-3build1 Β· GPL-2.0-or-later
- ubuntu noble: s3d-doc 0.2.2.1-6build3 Β· GPL-2.0-or-later
- ubuntu questing: s3d-doc 0.2.2.1-7build1
- ubuntu resolute: s3d-doc 0.2.2.1-7build3 Β· GPL-2.0-or-later
- ubuntu stonking: s3d-doc 0.2.3-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms