Gooey GUI Library
Loading...
Searching...
No Matches
gooey_list.h File Reference

Header file for the GooeyList widget. More...

#include "common/gooey_common.h"

Go to the source code of this file.

Functions

GooeyList * GooeyList_Create (int x, int y, int width, int height, void(*callback)(int index))
 Creates a widget.
 
void GooeyList_AddItem (GooeyList *list, const char *title, const char *description)
 Adds an item to the specified list widget.
 
void GooeyList_ClearItems (GooeyList *list)
 Clears all items from the specified list widget.
 
void GooeyList_ShowSeparator (GooeyList *list, bool state)
 Toggles the visibility of the separator in a list widget.
 
void GooeyList_UpdateItem (GooeyList *list, size_t item_index, const char *title, const char *description)
 

Detailed Description

Header file for the GooeyList widget.

Provides functionality for creating and managing list widgets within a GooeyWindow.

Author
Yassine Ahmed Ali @license GPL-3.0

Function Documentation

◆ GooeyList_AddItem()

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

Adds an item to the specified list widget.

Parameters
listThe list widget to which the item will be added.
titleThe title of the list item.
descriptionThe description of the list item.

◆ GooeyList_ClearItems()

void GooeyList_ClearItems ( GooeyList *  list)

Clears all items from the specified list widget.

Removes all list items from the provided list widget.

Parameters
listThe list widget to be cleared.

◆ GooeyList_Create()

GooeyList * GooeyList_Create ( int  x,
int  y,
int  width,
int  height,
void(*)(int index)  callback 
)

Creates a widget.

Creates a new list widget and attaches it to the given window.

Parameters
xThe x-coordinate of the list widget's position.
yThe y-coordinate of the list widget's position.
widthThe width of the list widget.
heightThe height of the list widget.
callbackThe function to be called when an item is selected.
Returns
A pointer to the newly created GooeyList object.

◆ GooeyList_ShowSeparator()

void GooeyList_ShowSeparator ( GooeyList *  list,
bool  state 
)

Toggles the visibility of the separator in a list widget.

Enables or disables the visual separator between list items.

Parameters
listThe list widget.
statetrue to show the separator, false to hide it.

◆ GooeyList_UpdateItem()

void GooeyList_UpdateItem ( GooeyList *  list,
size_t  item_index,
const char *  title,
const char *  description 
)