2015-06-11 18:07:06 -05:00
|
|
|
// 11 june 2015
|
|
|
|
#include "uipriv_unix.h"
|
|
|
|
|
2015-06-27 18:57:10 -05:00
|
|
|
// on GTK+ a uiRadioButtons is a GtkBox with each of the GtkRadioButtons as children
|
|
|
|
|
2015-06-11 18:07:06 -05:00
|
|
|
struct radiobuttons {
|
|
|
|
uiRadioButtons r;
|
2015-06-27 18:57:10 -05:00
|
|
|
GtkWidget *boxWidget;
|
|
|
|
GtkBox *box;
|
2015-06-11 18:07:06 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
uiDefineControlType(uiRadioButtons, uiTypeRadioButtons, struct radiobuttons)
|
|
|
|
|
2015-06-29 19:41:41 -05:00
|
|
|
// TODO note that the handle of a uiRadioButtons is undefined (or at least highly platform-dependent and unreliable)
|
2015-06-11 18:07:06 -05:00
|
|
|
static uintptr_t radiobuttonsHandle(uiControl *c)
|
|
|
|
{
|
2015-06-29 19:37:55 -05:00
|
|
|
struct radiobuttons *r = (struct radiobuttons *) c;
|
|
|
|
|
|
|
|
return (uintptr_t) (r->boxWidget);
|
2015-06-11 18:07:06 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
static void radiobuttonsAppend(uiRadioButtons *rr, const char *text)
|
|
|
|
{
|
|
|
|
struct radiobuttons *r = (struct radiobuttons *) rr;
|
|
|
|
|
|
|
|
PUT_CODE_HERE;
|
|
|
|
uiControlQueueResize(uiControl(r));
|
|
|
|
}
|
|
|
|
|
|
|
|
uiRadioButtons *uiNewRadioButtons(void)
|
|
|
|
{
|
|
|
|
struct radiobuttons *r;
|
|
|
|
|
2015-06-14 19:02:38 -05:00
|
|
|
r = (struct radiobuttons *) uiNewControl(uiTypeRadioButtons());
|
2015-06-11 18:07:06 -05:00
|
|
|
|
2015-06-27 18:57:10 -05:00
|
|
|
r->boxWidget = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
|
|
|
|
r->box = GTK_BOX(r->boxWidget);
|
|
|
|
uiUnixMakeSingleWidgetControl(uiControl(r), r->boxWidget);
|
2015-06-11 18:07:06 -05:00
|
|
|
|
|
|
|
uiControl(r)->Handle = radiobuttonsHandle;
|
|
|
|
|
|
|
|
uiRadioButtons(r)->Append = radiobuttonsAppend;
|
|
|
|
|
|
|
|
return uiRadioButtons(r);
|
|
|
|
}
|