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

N_GUI_LABEL_DATA

Module: GUI: allegro5 widget system with pseudo-windows

static text label specific data

#include "n_gui.h"

Public Attributes

Name
void * user_data
user data for callback
int truncate
how text too wide for the label is shortened: N_GUI_TRUNCATE_END (the default), N_GUI_TRUNCATE_START or N_GUI_TRUNCATE_PATH.
char[4096] text
text to display
int sel_start
selection start byte offset (-1 = no selection)
int sel_end
selection end byte offset (-1 = no selection)
int sel_dragging
1 if mouse is actively dragging to select text
float scroll_y
vertical scroll offset for overflowing text (pixels)
void(*)(int widget_id, const char *link, void *user_data) on_link_click
callback when link is clicked (widget_id, link_url, user_data)
char[4096] link
optional hyperlink URL (empty string = no link)
ALLEGRO_BITMAP * bg_bitmap
optional bitmap for the label background (NULL = no background)
int align
text alignment: N_GUI_ALIGN_LEFT, N_GUI_ALIGN_CENTER, N_GUI_ALIGN_RIGHT

Public Attributes Documentation

variable user_data

void * user_data;

user data for callback

variable truncate

int truncate;

how text too wide for the label is shortened: N_GUI_TRUNCATE_END (the default), N_GUI_TRUNCATE_START or N_GUI_TRUNCATE_PATH.

Not used by N_GUI_ALIGN_JUSTIFIED, which wraps

variable text

char[4096] text;

text to display

variable sel_start

int sel_start;

selection start byte offset (-1 = no selection)

variable sel_end

int sel_end;

selection end byte offset (-1 = no selection)

variable sel_dragging

int sel_dragging;

1 if mouse is actively dragging to select text

variable scroll_y

float scroll_y;

vertical scroll offset for overflowing text (pixels)

void(*)(int widget_id, const char *link, void *user_data) on_link_click;

callback when link is clicked (widget_id, link_url, user_data)

char[4096] link;

optional hyperlink URL (empty string = no link)

variable bg_bitmap

ALLEGRO_BITMAP * bg_bitmap;

optional bitmap for the label background (NULL = no background)

variable align

int align;

text alignment: N_GUI_ALIGN_LEFT, N_GUI_ALIGN_CENTER, N_GUI_ALIGN_RIGHT