ui/gtk/toolbar.c

changeset 3
c04433993fbb
parent 2
ea89bbb0c4c8
equal deleted inserted replaced
2:ea89bbb0c4c8 3:c04433993fbb
273 } 273 }
274 274
275 gtk_toolbar_insert(tb, button, -1); 275 gtk_toolbar_insert(tb, button, -1);
276 276
277 if(item->groups) { 277 if(item->groups) {
278 uic_add_group_widget(obj->ctx, button, item->groups); 278 uic_add_group_widget(obj->ctx, button, (ui_enablefunc)ui_set_enabled, item->groups);
279 } 279 }
280 } 280 }
281 281
282 void add_toolitem_st_widget(GtkToolbar *tb, UiStToolItem *item, UiObject *obj) { 282 void add_toolitem_st_widget(GtkToolbar *tb, UiStToolItem *item, UiObject *obj) {
283 GtkToolItem *button = gtk_tool_button_new_from_stock(item->stockid); 283 GtkToolItem *button = gtk_tool_button_new_from_stock(item->stockid);
302 } 302 }
303 303
304 gtk_toolbar_insert(tb, button, -1); 304 gtk_toolbar_insert(tb, button, -1);
305 305
306 if(item->groups) { 306 if(item->groups) {
307 uic_add_group_widget(obj->ctx, button, item->groups); 307 uic_add_group_widget(obj->ctx, button, (ui_enablefunc)ui_set_enabled, item->groups);
308 } 308 }
309 } 309 }
310 310
311 void add_toolitem_toggle_widget(GtkToolbar *tb, UiToggleToolItem *item, UiObject *obj) { 311 void add_toolitem_toggle_widget(GtkToolbar *tb, UiToggleToolItem *item, UiObject *obj) {
312 GtkToolItem *button; 312 GtkToolItem *button;
364 364
365 // add item to toolbar 365 // add item to toolbar
366 gtk_toolbar_insert(tb, button, -1); 366 gtk_toolbar_insert(tb, button, -1);
367 367
368 if(item->groups) { 368 if(item->groups) {
369 uic_add_group_widget(obj->ctx, button, item->groups); 369 uic_add_group_widget(obj->ctx, button, (ui_enablefunc)ui_set_enabled, item->groups);
370 } 370 }
371 } 371 }
372 372
373 void ui_tool_button_toggled(GtkToggleToolButton *widget, UiEventData *event) { 373 void ui_tool_button_toggled(GtkToggleToolButton *widget, UiEventData *event) {
374 UiEvent e; 374 UiEvent e;
388 integer->value = gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(integer->obj)); 388 integer->value = gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(integer->obj));
389 return integer->value; 389 return integer->value;
390 } 390 }
391 391
392 void ui_tool_toggle_button_set(UiInteger *integer, int64_t value) { 392 void ui_tool_toggle_button_set(UiInteger *integer, int64_t value) {
393 gboolean s = integer->value != 0 ? TRUE : FALSE; 393 gboolean s = value != 0 ? TRUE : FALSE;
394 gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(integer->obj), s); 394 gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(integer->obj), s);
395 integer->value = s; 395 integer->value = s;
396 } 396 }
397 397
398 void add_toolbar_combobox(GtkToolbar *tb, UiToolbarComboBox *cb, UiObject *obj) { 398 void add_toolbar_combobox(GtkToolbar *tb, UiToolbarComboBox *cb, UiObject *obj) {

mercurial