// widgetButton.h  -- Button widget API
#ifndef WIDGET_BUTTON_H
#define WIDGET_BUTTON_H

#include "../core/dvxWidget.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 // WIDGET_BUTTON_H
