// button.h  -- Button widget API
#ifndef BUTTON_H
#define BUTTON_H

#include "../../../libs/kpunch/libdvx/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
