DVX_GUI/widgets/box/box.h

23 lines
644 B
C

// box.h -- Box container widget API (VBox, HBox, Frame)
#ifndef BOX_H
#define BOX_H
#include "../../core/dvxWgt.h"
typedef struct {
WidgetT *(*vBox)(WidgetT *parent);
WidgetT *(*hBox)(WidgetT *parent);
WidgetT *(*frame)(WidgetT *parent, const char *title);
} BoxApiT;
static inline const BoxApiT *dvxBoxApi(void) {
static const BoxApiT *sApi;
if (!sApi) { sApi = (const BoxApiT *)wgtGetApi("box"); }
return sApi;
}
#define wgtVBox(parent) dvxBoxApi()->vBox(parent)
#define wgtHBox(parent) dvxBoxApi()->hBox(parent)
#define wgtFrame(parent, title) dvxBoxApi()->frame(parent, title)
#endif // BOX_H