2015-06-11 18:07:06 -05:00
|
|
|
// 11 june 2015
|
|
|
|
#include "uipriv_unix.h"
|
|
|
|
|
|
|
|
struct combobox {
|
|
|
|
uiCombobox c;
|
|
|
|
GtkWidget *widget;
|
2015-06-27 18:57:10 -05:00
|
|
|
GtkComboBox *combobox;
|
|
|
|
GtkComboBoxText *comboboxText;
|
2015-06-11 18:07:06 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
uiDefineControlType(uiCombobox, uiTypeCombobox, struct combobox)
|
|
|
|
|
|
|
|
static uintptr_t comboboxHandle(uiControl *cc)
|
|
|
|
{
|
|
|
|
struct combobox *c = (struct combobox *) cc;
|
|
|
|
|
|
|
|
return (uintptr_t) (c->widget);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void comboboxAppend(uiCombobox *cc, const char *text)
|
|
|
|
{
|
|
|
|
struct combobox *c = (struct combobox *) cc;
|
|
|
|
|
|
|
|
PUT_CODE_HERE;
|
|
|
|
}
|
|
|
|
|
2015-06-27 18:57:10 -05:00
|
|
|
static uiCombobox *finishNewCombobox(GtkWidget *(*newfunc)(void))
|
2015-06-11 18:07:06 -05:00
|
|
|
{
|
|
|
|
struct combobox *c;
|
|
|
|
|
2015-06-14 19:02:38 -05:00
|
|
|
c = (struct combobox *) uiNewControl(uiTypeCombobox());
|
2015-06-11 18:07:06 -05:00
|
|
|
|
2015-06-27 18:57:10 -05:00
|
|
|
c->widget = (*newfunc)();
|
|
|
|
c->combobox = GTK_COMBO_BOX(c->widget);
|
|
|
|
c->comboboxText = GTK_COMBO_BOX_TEXT(c->widget);
|
|
|
|
uiUnixMakeSingleWidgetControl(uiControl(c), c->widget);
|
2015-06-11 18:07:06 -05:00
|
|
|
|
|
|
|
uiControl(c)->Handle = comboboxHandle;
|
|
|
|
|
|
|
|
uiCombobox(c)->Append = comboboxAppend;
|
|
|
|
|
|
|
|
return uiCombobox(c);
|
|
|
|
}
|
|
|
|
|
|
|
|
uiCombobox *uiNewCombobox(void)
|
|
|
|
{
|
2015-06-14 18:58:00 -05:00
|
|
|
return finishNewCombobox(gtk_combo_box_text_new);
|
2015-06-11 18:07:06 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
uiCombobox *uiNewEditableCombobox(void)
|
|
|
|
{
|
2015-06-14 18:58:00 -05:00
|
|
|
return finishNewCombobox(gtk_combo_box_text_new_with_entry);
|
2015-06-11 18:07:06 -05:00
|
|
|
}
|