--- a/ui/gtk/button.h Sun May 23 09:44:43 2021 +0200 +++ b/ui/gtk/button.h Sat Jan 04 16:38:48 2025 +0100 @@ -36,18 +36,55 @@ #ifdef __cplusplus extern "C" { #endif + +void ui_button_set_icon_name(GtkWidget *button, const char *icon_name); +typedef void (*ui_toggled_func)(void*, void*); + +GtkWidget* ui_create_button( + UiObject *obj, + const char *label, + const char *icon, + ui_callback onclick, + void *userdata, + int event_value, + bool activate_event); + +void ui_setup_togglebutton( + UiObject *obj, + GtkWidget *togglebutton, + const char *label, + const char *icon, + const char *varname, + UiInteger *value, + ui_callback onchange, + void *onchangedata, + int enable_state); + +void ui_bind_togglebutton( + UiObject *obj, + GtkWidget *widget, + int64_t (*getfunc)(UiInteger*), + void (*setfunc)(UiInteger*, int64_t), + const char *varname, + UiInteger *value, + void (*toggled_callback)(void*, void*), + ui_callback onchange, + void *onchangedata, + void (*enable_state_func)(void*, void*), + int enable_state); + // event wrapper void ui_button_clicked(GtkWidget *widget, UiEventData *event); -void ui_toggled_obs(GtkToggleToolButton *widget, UiVarEventData *event); +void ui_toggled_obs(void *widget, UiVarEventData *event); UIWIDGET ui_checkbox_var(UiObject *obj, char *label, UiVar *var); UIWIDGET ui_radiobutton_var(UiObject *obj, char *label, UiVar *var); -void ui_radio_obs(GtkToggleToolButton *widget, UiVarEventData *event); +void ui_radio_obs(GtkToggleButton *widget, UiVarEventData *event); int64_t ui_radiobutton_get(UiInteger *value); void ui_radiobutton_set(UiInteger *value, int64_t i);