DVX_GUI/widgets/button/button.h

19 lines
456 B
C

// button.h -- Button widget API
#ifndef BUTTON_H
#define BUTTON_H
#include "../../core/dvxWgt.h"
typedef struct {
WidgetT *(*create)(WidgetT *parent, const char *text);
} ButtonApiT;
static inline const ButtonApiT *dvxButtonApi(void) {
static const ButtonApiT *sApi;
if (!sApi) { sApi = (const ButtonApiT *)wgtGetApi("button"); }
return sApi;
}
#define wgtButton(parent, text) dvxButtonApi()->create(parent, text)
#endif // BUTTON_H