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

idunn: a switch, 32 by 18 pixels: a round track (the input colour when off, the accent when on) and a white 14 pixel thumb that slides in 120 ms. More...

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

Macros

#define WIDTH   32
#define HEIGHT   18
#define THUMB   14
#define INSET   2
#define SLIDE_MS   120

Functions

idunn_widget_t * idunn_switch (const char *label, bool on, idunn_callback_t on_change, void *data)
 a switch with a label to its right; it slides when it changes.
bool idunn_switch_on (const idunn_widget_t *sw)
void idunn_switch_set_on (idunn_widget_t *sw, bool on)

Detailed Description

idunn: a switch, 32 by 18 pixels: a round track (the input colour when off, the accent when on) and a white 14 pixel thumb that slides in 120 ms.

Macro Definition Documentation

◆ WIDTH

#define WIDTH   32

◆ HEIGHT

#define HEIGHT   18

◆ THUMB

#define THUMB   14

◆ INSET

#define INSET   2

◆ SLIDE_MS

#define SLIDE_MS   120

Function Documentation

◆ idunn_switch()

idunn_widget_t * idunn_switch ( const char * label,
bool on,
idunn_callback_t on_change,
void * data )

a switch with a label to its right; it slides when it changes.

◆ idunn_switch_on()

bool idunn_switch_on ( const idunn_widget_t * sw)

◆ idunn_switch_set_on()

void idunn_switch_set_on ( idunn_widget_t * sw,
bool on )