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

Go to the source code of this file.

Functions

GooeyList * GooeyList_Add (GooeyWindow *window, int x, int y, int width, int height, void(*callback)(int index))
 Adds a list widget to the window specified.
 
void GooeyList_AddItem (GooeyList *list, const char *title, const char *description)
 Adds a list widget to the window specified.
 
bool GooeyList_HandleScroll (GooeyWindow *window, GooeyEvent *event)
 Handles scroll events.
 
bool GooeyList_HandleThumbScroll (GooeyWindow *window, GooeyEvent *scroll_event)
 
bool GooeyList_HandleClick (GooeyWindow *window, int mouse_x, int mouse_y)
 
void GooeyList_Draw (GooeyWindow *window)
 Draws All attached list widgets onto window.
 

Function Documentation

◆ GooeyList_Add()

GooeyList * GooeyList_Add ( GooeyWindow *  window,
int  x,
int  y,
int  width,
int  height,
void(*)(int index)  callback 
)

Adds a list widget to the window specified.

Parameters
windowThe window which you're adding the list widget to.
xThe x-coordinate of the list widget.
yThe y-coordinate of the list widget.
widthThe width of the list widget.
heightThe height of the list widget.
callbackThe callback attached to the said item.

◆ GooeyList_AddItem()

void GooeyList_AddItem ( GooeyList *  list,
const char *  title,
const char *  description 
)

Adds a list widget to the window specified.

Parameters
listThe List widget you're adding the item to.
titleThe title of the list widget item.
descriptionThe description of the list widget item.

◆ GooeyList_Draw()

void GooeyList_Draw ( GooeyWindow *  window)

Draws All attached list widgets onto window.

Parameters
windowThe window which you're adding the list widget to.

◆ GooeyList_HandleClick()

bool GooeyList_HandleClick ( GooeyWindow *  window,
int  mouse_x,
int  mouse_y 
)

◆ GooeyList_HandleScroll()

bool GooeyList_HandleScroll ( GooeyWindow *  window,
GooeyEvent *  event 
)

Handles scroll events.

Parameters
windowThe window containing the list.
eventThe scroll event.
Returns
if mouse scroll event then returns true, otherwise returns false.

◆ GooeyList_HandleThumbScroll()

bool GooeyList_HandleThumbScroll ( GooeyWindow *  window,
GooeyEvent *  scroll_event 
)

Handles thumb dragging for a GooeyList.

Parameters
windowPointer to the GooeyWindow.
scroll_eventPointer to the GooeyEvent.
Returns
True if the event was handled, false otherwise.