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

N_GUI_TREE

Module: GUI: allegro5 widget system with pseudo-windows

tree view built from an N_GUI listbox

#include "n_gui.h"

Public Attributes

Name
int window_id
owning window for coord math
int[2048] visible_map
visible row to node index
void * user_data
user data for callback
void(*)(int, void *) on_select
selection callback
void(*)(int, void *) on_expand
fills a node the first time it opens, or NULL
n_gui_tree_on_drop_t on_drop
drag-reorder state (managed by n_gui_tree_tick)
N_GUI_TREE_NODE[2048] nodes
node storage
int nb_visible
number of visible rows
int nb_nodes
number of nodes
int mouse_b1_prev
previous frame's b1 state
int listbox_id
listbox widget ID
void * expand_user_data
user data for on_expand
void * drop_user_data
user data for on_drop
int drop_position
N_GUI_DROP_BEFORE / INTO / AFTER.
int drag_source_node
node being dragged, or -1
float drag_press_y
mouse y at press time
float drag_press_x
mouse x at press time
int drag_hover_node
current hover node, or -1
int drag_armed_node
pressed-but-not-yet-dragging
int drag_active
1 once past threshold
N_GUI_CTX * ctx
GUI context.

Public Attributes Documentation

variable window_id

int window_id;

owning window for coord math

variable visible_map

int[2048] visible_map;

visible row to node index

variable user_data

void * user_data;

user data for callback

variable on_select

void(*)(int, void *) on_select;

selection callback

variable on_expand

void(*)(int, void *) on_expand;

fills a node the first time it opens, or NULL

variable on_drop

n_gui_tree_on_drop_t on_drop;

drag-reorder state (managed by n_gui_tree_tick)

drop callback, or NULL

variable nodes

N_GUI_TREE_NODE[2048] nodes;

node storage

variable nb_visible

int nb_visible;

number of visible rows

variable nb_nodes

int nb_nodes;

number of nodes

variable mouse_b1_prev

int mouse_b1_prev;

previous frame's b1 state

variable listbox_id

int listbox_id;

listbox widget ID

variable expand_user_data

void * expand_user_data;

user data for on_expand

variable drop_user_data

void * drop_user_data;

user data for on_drop

variable drop_position

int drop_position;

N_GUI_DROP_BEFORE / INTO / AFTER.

variable drag_source_node

int drag_source_node;

node being dragged, or -1

variable drag_press_y

float drag_press_y;

mouse y at press time

variable drag_press_x

float drag_press_x;

mouse x at press time

variable drag_hover_node

int drag_hover_node;

current hover node, or -1

variable drag_armed_node

int drag_armed_node;

pressed-but-not-yet-dragging

variable drag_active

int drag_active;

1 once past threshold

variable ctx

N_GUI_CTX * ctx;

GUI context.