Gooey GUI Library
Loading...
Searching...
No Matches
gooey_slider.h File Reference
#include "core/gooey_backend_internal.h"
#include "gooey_event_internal.h"

Go to the source code of this file.

Functions

GooeySlider * GooeySlider_Add (GooeyWindow *win, int x, int y, int width, long min_value, long max_value, bool show_hints, void(*callback)(long value))
 Adds a slider to the window.
 
bool GooeySlider_HandleDrag (GooeyWindow *win, GooeyEvent *event)
 Handles slider drag events.
 
long GooeySlider_GetValue (GooeySlider *slider)
 Gets the current value of the slider.
 
void GooeySlider_SetValue (GooeySlider *slider, long value)
 Sets the value of the slider.
 
void GooeySlider_Draw (GooeyWindow *window)
 

Function Documentation

◆ GooeySlider_Add()

GooeySlider * GooeySlider_Add ( GooeyWindow *  win,
int  x,
int  y,
int  width,
long  min_value,
long  max_value,
bool  show_hints,
void(*)(long value)  callback 
)

Adds a slider to the window.

Parameters
winThe window to add the slider to.
xThe x-coordinate of the slider's position.
yThe y-coordinate of the slider's position.
widthThe width of the slider.
min_valueThe minimum value of the slider.
max_valueThe maximum value of the slider.
show_hintsWhether to show hints for the slider.
callbackThe callback function to call when the slider value changes.
Returns
A new GooeySlider object.

◆ GooeySlider_Draw()

void GooeySlider_Draw ( GooeyWindow *  window)

◆ GooeySlider_GetValue()

long GooeySlider_GetValue ( GooeySlider *  slider)

Gets the current value of the slider.

Parameters
sliderThe slider to get the value from.
Returns
The current value of the slider.

◆ GooeySlider_HandleDrag()

bool GooeySlider_HandleDrag ( GooeyWindow *  win,
GooeyEvent *  event 
)

Handles slider drag events.

Parameters
winThe window containing the slider.
eventThe current event.
Returns
True if the slider was dragged, false otherwise.

◆ GooeySlider_SetValue()

void GooeySlider_SetValue ( GooeySlider *  slider,
long  value 
)

Sets the value of the slider.

Parameters
sliderThe slider to set the value for.
valueThe new value for the slider.