21 lines
601 B
C
21 lines
601 B
C
// widgetLabel.h -- Label widget API
|
|
#ifndef WIDGET_LABEL_H
|
|
#define WIDGET_LABEL_H
|
|
|
|
#include "../core/dvxWidget.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 // WIDGET_LABEL_H
|