// label.h -- Label widget API #ifndef LABEL_H #define LABEL_H #include "../../core/dvxWgt.h" typedef struct { WidgetT *(*create)(WidgetT *parent, const char *text); void (*setAlign)(WidgetT *w, WidgetAlignE align); } LabelApiT; static inline const LabelApiT *dvxLabelApi(void) { static const LabelApiT *sApi; if (!sApi) { sApi = (const LabelApiT *)wgtGetApi("label"); } return sApi; } #define wgtLabel(parent, text) dvxLabelApi()->create(parent, text) #define wgtLabelSetAlign(w, align) dvxLabelApi()->setAlign(w, align) #endif // LABEL_H