#include #include "uiLibrary.h" #include "widget.h" uiLabel* uiMakeLabel(const char* text) { assert(text); uiLabel* label = UI_NEW(uiLabel); *label = (uiLabel){ .widget = (uiWidget){ .type = uiTypeLabel, .rect = (uiRect){ .width = (int)strlen(text) * g_ui.font->header.glyph_width, .height = g_ui.font->header.glyph_height}}, .text = string_new(text), }; return label; } const char* uiLabelGetText(const uiLabel* label) { assert(label); return string_data(label->text); }