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

N_GUI_SECTIONLIST

Module: GUI: allegro5 widget system with pseudo-windows

a vertical accordion of foldable sections inside one window; folding hides a section's widgets and re-stacks the rest, leaving the window's N_GUI_WIN_AUTO_SCROLLBAR to absorb any overflow

#include "n_gui.h"

Public Attributes

Name
float y0
content-local y of the first header
float x
content-local x of every header and the layout origin
int window_id
window holding the headers and members
float width
header width
void * user_data
user data for the callback
N_GUI_SECTION[16] sections
section storage
int[16] section_hidden
1 = the whole section, header and members, is left out of the stack
int[16] order
display order: order[k] is the index of the section stacked k-th; indices themselves never change
void(*)(int, int, void *) on_toggle
callback(section_index, folded, user_data) on a header click (may be NULL)
int nb_sections
number of sections
float header_h
header button height
float gap
vertical gap between rows
float first_inset
content-local left inset applied to the FIRST header only, so a button can sit before it on the same row (0 = none)
N_GUI_CTX * ctx
GUI context.

Public Attributes Documentation

variable y0

float y0;

content-local y of the first header

variable x

float x;

content-local x of every header and the layout origin

variable window_id

int window_id;

window holding the headers and members

variable width

float width;

header width

variable user_data

void * user_data;

user data for the callback

variable sections

N_GUI_SECTION[16] sections;

section storage

variable section_hidden

int[16] section_hidden;

1 = the whole section, header and members, is left out of the stack

variable order

int[16] order;

display order: order[k] is the index of the section stacked k-th; indices themselves never change

variable on_toggle

void(*)(int, int, void *) on_toggle;

callback(section_index, folded, user_data) on a header click (may be NULL)

variable nb_sections

int nb_sections;

number of sections

variable header_h

float header_h;

header button height

variable gap

float gap;

vertical gap between rows

variable first_inset

float first_inset;

content-local left inset applied to the FIRST header only, so a button can sit before it on the same row (0 = none)

variable ctx

N_GUI_CTX * ctx;

GUI context.