Implemented the text routines on the GTK+ backend. They work!
This commit is contained in:
parent
a0073727c8
commit
723f2af8c6
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
// 9 april 2015
|
||||
#include "uipriv_unix.h"
|
||||
|
||||
void uiFreeText(char *t)
|
||||
{
|
||||
g_free(t);
|
||||
}
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue