2015-04-11 21:49:41 -05:00
|
|
|
// 11 april 2015
|
|
|
|
#include "uipriv_unix.h"
|
|
|
|
|
|
|
|
struct label {
|
2015-04-15 21:17:02 -05:00
|
|
|
uiLabel l;
|
2015-04-16 21:21:02 -05:00
|
|
|
GtkWidget *widget;
|
|
|
|
GtkLabel *label;
|
2015-04-11 21:49:41 -05:00
|
|
|
};
|
|
|
|
|
2015-04-18 16:14:19 -05:00
|
|
|
static void onDestroy(void *data)
|
2015-04-11 21:49:41 -05:00
|
|
|
{
|
2015-04-18 16:14:19 -05:00
|
|
|
struct label *l = (struct label *) data;
|
2015-04-11 21:49:41 -05:00
|
|
|
|
|
|
|
uiFree(l);
|
|
|
|
}
|
|
|
|
|
2015-04-16 21:21:02 -05:00
|
|
|
static char *labelText(uiLabel *ll)
|
2015-04-15 21:17:02 -05:00
|
|
|
{
|
2015-04-16 21:21:02 -05:00
|
|
|
struct label *l = (struct label *) ll;
|
|
|
|
|
2015-04-30 21:55:06 -05:00
|
|
|
return uiUnixStrdupText(gtk_label_get_text(l->label));
|
2015-04-15 21:17:02 -05:00
|
|
|
}
|
|
|
|
|
2015-04-16 21:21:02 -05:00
|
|
|
static void labelSetText(uiLabel *ll, const char *text)
|
2015-04-15 21:17:02 -05:00
|
|
|
{
|
2015-04-16 21:21:02 -05:00
|
|
|
struct label *l = (struct label *) ll;
|
|
|
|
|
|
|
|
gtk_label_set_text(l->label, text);
|
2015-04-15 21:17:02 -05:00
|
|
|
}
|
|
|
|
|
2015-04-15 22:07:43 -05:00
|
|
|
uiLabel *uiNewLabel(const char *text)
|
2015-04-11 21:49:41 -05:00
|
|
|
{
|
|
|
|
struct label *l;
|
|
|
|
|
2015-04-15 21:17:02 -05:00
|
|
|
l = uiNew(struct label);
|
|
|
|
|
2015-04-29 09:36:31 -05:00
|
|
|
l->widget = GTK_WIDGET(uiControlHandle(uiControl(l)));
|
2015-04-16 21:21:02 -05:00
|
|
|
l->label = GTK_LABEL(l->widget);
|
|
|
|
|
|
|
|
uiLabel(l)->Text = labelText;
|
|
|
|
uiLabel(l)->SetText = labelSetText;
|
2015-04-11 21:49:41 -05:00
|
|
|
|
2015-04-15 21:17:02 -05:00
|
|
|
return uiLabel(l);
|
2015-04-11 21:49:41 -05:00
|
|
|
}
|