diff --git a/new/button_unix.c b/new/button_unix.c index a39bdf5..c458e68 100644 --- a/new/button_unix.c +++ b/new/button_unix.c @@ -47,7 +47,15 @@ uiControl *uiNewButton(const char *text) return b->c; } -// TODO text +char *uiButtonText(uiControl *c) +{ + return g_strdup(gtk_button_get_label(GTK_BUTTON(uiControlHandle(c)))); +} + +void uiButtonSetText(uiControl *c, const char *text) +{ + gtk_button_set_label(GTK_BUTTON(uiControlHandle(c)), text); +} void uiButtonOnClicked(uiControl *c, void (*f)(uiControl *, void *), void *data) { diff --git a/new/entry_unix.c b/new/entry_unix.c index 2316618..04005d3 100644 --- a/new/entry_unix.c +++ b/new/entry_unix.c @@ -30,3 +30,13 @@ uiControl *uiNewEntry(void) return e->c; } + +char *uiEntryText(uiControl *c) +{ + return g_strdup(gtk_entry_get_text(GTK_ENTRY(uiControlHandle(c)))); +} + +void uiEntrySetText(uiControl *c, const char *text) +{ + gtk_entry_set_text(GTK_ENTRY(uiControlHandle(c)), text); +} diff --git a/new/util_unix.c b/new/util_unix.c new file mode 100644 index 0000000..72b71df --- /dev/null +++ b/new/util_unix.c @@ -0,0 +1,7 @@ +// 9 april 2015 +#include "uipriv_unix.h" + +void uiFreeText(char *t) +{ + g_free(t); +} diff --git a/new/window_unix.c b/new/window_unix.c index 293fa51..dca52e3 100644 --- a/new/window_unix.c +++ b/new/window_unix.c @@ -39,7 +39,15 @@ uintptr_t uiWindowHandle(uiWindow *w) return (uintptr_t) (w->widget); } -// TODO titles +char *uiWindowTitle(uiWindow *w) +{ + return g_strdup(gtk_window_get_title(GTK_WINDOW(w->widget))); +} + +void uiWindowSetTitle(uiWindow *w, const char *title) +{ + gtk_window_set_title(GTK_WINDOW(w->widget), title); +} void uiWindowShow(uiWindow *w) {