Gooey GUI Library
Loading...
Searching...
No Matches
gooey_slider.h File Reference
#include "common/gooey_common.h"
#include <stdbool.h>

Go to the source code of this file.

Functions

GooeySlider * GooeySlider_Create (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.
 
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.
 

Function Documentation

◆ GooeySlider_Create()

GooeySlider * GooeySlider_Create ( 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.

This function creates and adds a slider to the specified window at the given position with a defined width and range. The slider's value changes when dragged, and a callback function is invoked to notify when the slider value changes.

Parameters
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_GetValue()

long GooeySlider_GetValue ( GooeySlider *  slider)

Gets the current value of the slider.

This function retrieves the current value of the slider. The value is within the range specified by the slider's minimum and maximum values.

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

◆ GooeySlider_SetValue()

void GooeySlider_SetValue ( GooeySlider *  slider,
long  value 
)

Sets the value of the slider.

This function sets the slider's value to the specified value within the slider's valid range (between the minimum and maximum values).

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