Finished the control stubbing. Everything (that is expected to work) works (so far)!

This commit is contained in:
Pietro Gagliardi 2015-06-27 19:57:10 -04:00
parent 7cafbd223a
commit 2ca99e3ffe
3 changed files with 16 additions and 4 deletions

View File

@ -4,6 +4,8 @@
struct combobox { struct combobox {
uiCombobox c; uiCombobox c;
GtkWidget *widget; GtkWidget *widget;
GtkComboBox *combobox;
GtkComboBoxText *comboboxText;
}; };
uiDefineControlType(uiCombobox, uiTypeCombobox, struct combobox) uiDefineControlType(uiCombobox, uiTypeCombobox, struct combobox)
@ -22,13 +24,16 @@ static void comboboxAppend(uiCombobox *cc, const char *text)
PUT_CODE_HERE; PUT_CODE_HERE;
} }
static uiCombobox *finishNewCombobox(GtkWidget (*newfunc)(void)) static uiCombobox *finishNewCombobox(GtkWidget *(*newfunc)(void))
{ {
struct combobox *c; struct combobox *c;
c = (struct combobox *) uiNewControl(uiTypeCombobox()); c = (struct combobox *) uiNewControl(uiTypeCombobox());
PUT_CODE_HERE; c->widget = (*newfunc)();
c->combobox = GTK_COMBO_BOX(c->widget);
c->comboboxText = GTK_COMBO_BOX_TEXT(c->widget);
uiUnixMakeSingleWidgetControl(uiControl(c), c->widget);
uiControl(c)->Handle = comboboxHandle; uiControl(c)->Handle = comboboxHandle;

View File

@ -29,7 +29,8 @@ uiDateTimePicker *finishNewDateTimePicker(OSTHING OSARG)
d = (struct datetimepicker *) uiNewControl(uiTypeDateTimePicker()); d = (struct datetimepicker *) uiNewControl(uiTypeDateTimePicker());
PUT_CODE_HERE; d->widget = gtk_label_new("TODO uiDateTimePicker not implemented");
uiUnixMakeSingleWidgetControl(uiControl(d), d->widget);
uiControl(d)->Handle = datetimepickerHandle; uiControl(d)->Handle = datetimepickerHandle;

View File

@ -1,8 +1,12 @@
// 11 june 2015 // 11 june 2015
#include "uipriv_unix.h" #include "uipriv_unix.h"
// on GTK+ a uiRadioButtons is a GtkBox with each of the GtkRadioButtons as children
struct radiobuttons { struct radiobuttons {
uiRadioButtons r; uiRadioButtons r;
GtkWidget *boxWidget;
GtkBox *box;
}; };
uiDefineControlType(uiRadioButtons, uiTypeRadioButtons, struct radiobuttons) uiDefineControlType(uiRadioButtons, uiTypeRadioButtons, struct radiobuttons)
@ -26,7 +30,9 @@ uiRadioButtons *uiNewRadioButtons(void)
r = (struct radiobuttons *) uiNewControl(uiTypeRadioButtons()); r = (struct radiobuttons *) uiNewControl(uiTypeRadioButtons());
PUT_CODE_HERE; r->boxWidget = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
r->box = GTK_BOX(r->boxWidget);
uiUnixMakeSingleWidgetControl(uiControl(r), r->boxWidget);
uiControl(r)->Handle = radiobuttonsHandle; uiControl(r)->Handle = radiobuttonsHandle;