The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
select.c File Reference

idunn: a select: a button like a text field with the chosen value and a chevron. More...

#include "idunn_internal.h"
#include <stdint.h>
#include <stdlib.h>
#include <string.h>

Macros

#define HEIGHT   32
#define PAD   12
#define ICON   16
#define WIDTH   200

Functions

idunn_widget_t * idunn_select (const char *const *choices, int count, int chosen, idunn_callback_t on_change, void *data)
 a select: a field with the chosen value; it opens a menu of the choices.
int idunn_select_chosen (const idunn_widget_t *select)
void idunn_select_choose (idunn_widget_t *select, int chosen)
void idunn_select_set_placeholder (idunn_widget_t *select, const char *text)

Detailed Description

idunn: a select: a button like a text field with the chosen value and a chevron.

a click, Space, Enter or the arrows open a menu of the choices under it, as wide as it, with a check at the chosen one.

Macro Definition Documentation

◆ HEIGHT

#define HEIGHT   32

◆ PAD

#define PAD   12

◆ ICON

#define ICON   16

◆ WIDTH

#define WIDTH   200

Function Documentation

◆ idunn_select()

idunn_widget_t * idunn_select ( const char *const * choices,
int count,
int chosen,
idunn_callback_t on_change,
void * data )

a select: a field with the chosen value; it opens a menu of the choices.

Parameters
chosenthe index of the chosen one, or -1 (the placeholder shows).

◆ idunn_select_chosen()

int idunn_select_chosen ( const idunn_widget_t * select)

◆ idunn_select_choose()

void idunn_select_choose ( idunn_widget_t * select,
int chosen )

◆ idunn_select_set_placeholder()

void idunn_select_set_placeholder ( idunn_widget_t * select,
const char * text )