5 Struct N_GUI_KVTABLE
gullradriel edited this page 2026-10-09 00:55:18 +02:00

N_GUI_KVTABLE

Module: GUI: allegro5 widget system with pseudo-windows

key-value table built from textareas, checkboxes, and buttons. More...

#include "n_gui.h"

Public Attributes

Name
int window_id
parent window
char * value_placeholder
owned hint shown in each value textarea, or NULL
void * user_data
user data for callback
float top_offset
unscaled y offset of the header row from the window top (default 0), to reserve space above the table for other widgets
int split_b
splitpane widget ID of the divider after the second text column, or -1
int split_a
splitpane widget ID of the divider after the first text column, or -1
int show_value
1 to show the Value column (default 1)
int show_enabled
1 to show the enabled-checkbox column (default 1)
int show_desc
1 to show the Description column (default 1)
int show_actions
1 to show the per-row move-up / move-down / duplicate buttons (default 0)
N_GUI_KV_ROW[128] rows
row storage
float row_height
unscaled row height in pixels
float padding
unscaled padding in pixels
void(*)(int, void *) on_remove
callback on row removal
int nb_rows
total rows (including removed)
int nb_active
active row count
int lbl_value
label widget ID for "Value" header
int lbl_key
label widget ID for "Key" header
int lbl_enabled
label widget ID for "On" header
int lbl_desc
label widget ID for "Description" header
char * key_placeholder
owned hint shown in each key textarea, or NULL
float init_win_w
parent window width at create time
float init_win_h
parent window height at create time
float header_height
unscaled column-header row height
int frac_cols
visible text column count col_frac was computed for; when it changes the fractions reset to equal widths
N_GUI_CTX * ctx
GUI context.
float[3] col_frac
width fraction of each visible text column over the text area, summing to 1; user-adjusted by the column dividers
int btn_add
button widget ID for "+" add row

Detailed Description

struct N_GUI_KVTABLE;

key-value table built from textareas, checkboxes, and buttons.

The text columns are separated by draggable dividers (split panes spanning the table height), so the user can widen a column whose content overflows; the trailing checkbox/action/remove cluster keeps its fixed width

Public Attributes Documentation

variable window_id

int window_id;

parent window

variable value_placeholder

char * value_placeholder;

owned hint shown in each value textarea, or NULL

variable user_data

void * user_data;

user data for callback

variable top_offset

float top_offset;

unscaled y offset of the header row from the window top (default 0), to reserve space above the table for other widgets

variable split_b

int split_b;

splitpane widget ID of the divider after the second text column, or -1

variable split_a

int split_a;

splitpane widget ID of the divider after the first text column, or -1

variable show_value

int show_value;

1 to show the Value column (default 1)

variable show_enabled

int show_enabled;

1 to show the enabled-checkbox column (default 1)

variable show_desc

int show_desc;

1 to show the Description column (default 1)

variable show_actions

int show_actions;

1 to show the per-row move-up / move-down / duplicate buttons (default 0)

variable rows

N_GUI_KV_ROW[128] rows;

row storage

variable row_height

float row_height;

unscaled row height in pixels

variable padding

float padding;

unscaled padding in pixels

variable on_remove

void(*)(int, void *) on_remove;

callback on row removal

variable nb_rows

int nb_rows;

total rows (including removed)

variable nb_active

int nb_active;

active row count

variable lbl_value

int lbl_value;

label widget ID for "Value" header

variable lbl_key

int lbl_key;

label widget ID for "Key" header

variable lbl_enabled

int lbl_enabled;

label widget ID for "On" header

variable lbl_desc

int lbl_desc;

label widget ID for "Description" header

variable key_placeholder

char * key_placeholder;

owned hint shown in each key textarea, or NULL

variable init_win_w

float init_win_w;

parent window width at create time

variable init_win_h

float init_win_h;

parent window height at create time

variable header_height

float header_height;

unscaled column-header row height

variable frac_cols

int frac_cols;

visible text column count col_frac was computed for; when it changes the fractions reset to equal widths

variable ctx

N_GUI_CTX * ctx;

GUI context.

variable col_frac

float[3] col_frac;

width fraction of each visible text column over the text area, summing to 1; user-adjusted by the column dividers

variable btn_add

int btn_add;

button widget ID for "+" add row