ui/gtk/button.c

changeset 45
ab71409644b0
parent 44
473954dc6b74
child 51
e324291ca9f8
equal deleted inserted replaced
44:473954dc6b74 45:ab71409644b0
88 } 88 }
89 89
90 UIWIDGET ui_button_create(UiObject *obj, UiButtonArgs args) { 90 UIWIDGET ui_button_create(UiObject *obj, UiButtonArgs args) {
91 UiObject* current = uic_current_obj(obj); 91 UiObject* current = uic_current_obj(obj);
92 GtkWidget *button = ui_create_button(obj, args.label, args.icon, args.onclick, args.onclickdata); 92 GtkWidget *button = ui_create_button(obj, args.label, args.icon, args.onclick, args.onclickdata);
93 ui_set_name_and_style(button, args.name, args.style_class);
93 UI_APPLY_LAYOUT1(current, args); 94 UI_APPLY_LAYOUT1(current, args);
94 current->container->add(current->container, button, FALSE); 95 current->container->add(current->container, button, FALSE);
95 return button; 96 return button;
96 } 97 }
97 98
228 229
229 static UIWIDGET togglebutton_create(UiObject *obj, GtkWidget *widget, UiToggleArgs args) { 230 static UIWIDGET togglebutton_create(UiObject *obj, GtkWidget *widget, UiToggleArgs args) {
230 UiObject* current = uic_current_obj(obj); 231 UiObject* current = uic_current_obj(obj);
231 232
232 ui_setup_togglebutton(current, widget, args.label, args.icon, args.varname, args.value, args.onchange, args.onchangedata); 233 ui_setup_togglebutton(current, widget, args.label, args.icon, args.varname, args.value, args.onchange, args.onchangedata);
234 ui_set_name_and_style(widget, args.name, args.style_class);
233 235
234 UI_APPLY_LAYOUT1(current, args); 236 UI_APPLY_LAYOUT1(current, args);
235 current->container->add(current->container, widget, FALSE); 237 current->container->add(current->container, widget, FALSE);
236 238
237 return widget; 239 return widget;
338 first = TRUE; 340 first = TRUE;
339 } 341 }
340 } 342 }
341 343
342 GtkWidget *rbutton = RADIOBUTTON_NEW(rg, args.label); 344 GtkWidget *rbutton = RADIOBUTTON_NEW(rg, args.label);
345 ui_set_name_and_style(rbutton, args.name, args.style_class);
343 if(rgroup) { 346 if(rgroup) {
344 #if GTK_MAJOR_VERSION >= 4 347 #if GTK_MAJOR_VERSION >= 4
345 if(rg) { 348 if(rg) {
346 gtk_check_button_set_group(GTK_CHECK_BUTTON(rbutton), rg->data); 349 gtk_check_button_set_group(GTK_CHECK_BUTTON(rbutton), rg->data);
347 } 350 }

mercurial