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

idunn: a text area: text in lines that wrap at spaces, in the same well as a text field. More...

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

Macros

#define PAD_X   12
#define PAD_Y   8
#define ROWS   4
#define WIDTH   240
#define BLINK_MS   500
#define WHEEL   3

Functions

idunn_widget_t * idunn_text_area (const char *placeholder, int rows)
 a text area: lines that wrap, Enter for a new line; it scrolls.
const char * idunn_text_area_text (const idunn_widget_t *area)
void idunn_text_area_set_text (idunn_widget_t *area, const char *text)
void idunn_text_area_on_change (idunn_widget_t *area, idunn_callback_t on_change, void *data)

Detailed Description

idunn: a text area: text in lines that wrap at spaces, in the same well as a text field.

Enter makes a new line; Up and Down keep the caret's column; the text scrolls with the caret and the wheel.

Macro Definition Documentation

◆ PAD_X

#define PAD_X   12

◆ PAD_Y

#define PAD_Y   8

◆ ROWS

#define ROWS   4

◆ WIDTH

#define WIDTH   240

◆ BLINK_MS

#define BLINK_MS   500

◆ WHEEL

#define WHEEL   3

Function Documentation

◆ idunn_text_area()

idunn_widget_t * idunn_text_area ( const char * placeholder,
int rows )

a text area: lines that wrap, Enter for a new line; it scrolls.

Parameters
rowsthe lines it shows (its height), 0 for 4.

◆ idunn_text_area_text()

const char * idunn_text_area_text ( const idunn_widget_t * area)

◆ idunn_text_area_set_text()

void idunn_text_area_set_text ( idunn_widget_t * area,
const char * text )

◆ idunn_text_area_on_change()

void idunn_text_area_on_change ( idunn_widget_t * area,
idunn_callback_t on_change,
void * data )