1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#include <ui.h> #include "widget.h" uiButton* uiMakeButton(const char* text) { assert(text); uiButton* button = UI_NEW(uiButton); *button = (uiButton){ .widget = (uiWidget){ .type = uiTypeButton, .rect = {0}, }, .text = string_new(text), }; return button; }