diff --git a/test.c b/test.c index 77f74b7c..53869e7a 100644 --- a/test.c +++ b/test.c @@ -11,7 +11,6 @@ int onClosing(uiWindow *w, void *data) uiControl *e; -/*TODO static void getWindowText(uiControl *b, void *data) { char *text; @@ -47,7 +46,6 @@ static void setButtonText(uiControl *b, void *data) uiButtonSetText((uiControl *) data, text); uiFreeText(text); } -*/ int main(int argc, char *argv[]) { @@ -75,18 +73,18 @@ int main(int argc, char *argv[]) buttonStack = uiNewHorizontalStack(); getButton = uiNewButton("Get Window Text"); -//TODO uiButtonOnClicked(getButton, getWindowText, w); + uiButtonOnClicked(getButton, getWindowText, w); setButton = uiNewButton("Set Window Text"); -//TODO uiButtonOnClicked(setButton, setWindowText, w); + uiButtonOnClicked(setButton, setWindowText, w); uiStackAdd(buttonStack, getButton, 1); uiStackAdd(buttonStack, setButton, 1); uiStackAdd(mainStack, buttonStack, 0); buttonStack = uiNewHorizontalStack(); getButton = uiNewButton("Get Button Text"); -//TODO uiButtonOnClicked(getButton, getButtonText, getButton); + uiButtonOnClicked(getButton, getButtonText, getButton); setButton = uiNewButton("Set Button Text"); -//TODO uiButtonOnClicked(setButton, setButtonText, getButton); + uiButtonOnClicked(setButton, setButtonText, getButton); uiStackAdd(buttonStack, getButton, 1); uiStackAdd(buttonStack, setButton, 1); uiStackAdd(mainStack, buttonStack, 0); diff --git a/ui.h b/ui.h index 232b783e..435ec280 100644 --- a/ui.h +++ b/ui.h @@ -15,6 +15,8 @@ void uiInitErrorFree(uiInitError *); void uiMain(void); void uiQuit(void); +void uiFreeText(char *); + typedef struct uiControl uiControl; void uiControlDestroy(uiControl *); uintptr_t uiControlHandle(uiControl *); @@ -23,14 +25,16 @@ typedef struct uiWindow uiWindow; uiWindow *uiNewWindow(char *, int, int); void uiWindowDestroy(uiWindow *); uintptr_t uiWindowHandle(uiWindow *); -// TODO titles +char *uiWindowTitle(uiWindow *); +void uiWindowSetTitle(uiWindow *, const char *); void uiWindowShow(uiWindow *); void uiWindowHide(uiWindow *); void uiWindowOnClosing(uiWindow *, int (*)(uiWindow *, void *), void *); void uiWindowSetChild(uiWindow *, uiControl *); uiControl *uiNewButton(const char *); -// TODO text +char *uiButtonText(uiControl *); +void uiButtonSetText(uiControl *, const char *); void uiButtonOnClicked(uiControl *, void (*)(uiControl *, void *), void *); uiControl *uiNewHorizontalStack(void); @@ -38,5 +42,7 @@ uiControl *uiNewVerticalStack(void); void uiStackAdd(uiControl *, uiControl *, int); uiControl *uiNewEntry(void); +char *uiEntryText(uiControl *); +void uiEntrySetText(uiControl *, const char *); #endif