diff -r a7f18dda6baf -r 0ebf9d7b23e8 ui/motif/button.h --- a/ui/motif/button.h Wed Dec 04 08:57:35 2024 +0100 +++ b/ui/motif/button.h Wed Dec 04 18:31:22 2024 +0100 @@ -36,30 +36,22 @@ extern "C" { #endif -typedef struct { - CxList *buttons; - Widget current; - int ref; -} RadioButtonGroup; - -typedef struct { - UiObject *obj; - ui_callback callback; - void *userdata; - RadioButtonGroup *group; -} RadioEventData; - -// wrapper -int64_t ui_toggle_button_get(UiInteger *i); -void ui_toggle_button_set(UiInteger *i, int64_t value); -void ui_toggle_button_callback( - Widget widget, - UiEventData *data, - XmToggleButtonCallbackStruct *e); void ui_push_button_callback(Widget widget, UiEventData *event, XtPointer d); -int64_t ui_radiobutton_get(UiInteger *value); -void ui_radiobutton_set(UiInteger *value, int64_t i); +void ui_bind_togglebutton( + UiObject *obj, + Widget widget, + const char *varname, + UiInteger *value, + ui_callback onchange, + void *onchangedata, + int enable_state); + +int64_t ui_togglebutton_get(UiInteger *i); +void ui_togglebutton_set(UiInteger *i, int64_t value); + +int64_t ui_radiobutton_get(UiInteger *i); +void ui_radiobutton_set(UiInteger *i, int64_t value); #ifdef __cplusplus }