1 /* |
1 /* |
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
3 * |
3 * |
4 * Copyright 2014 Olaf Wintermann. All rights reserved. |
4 * Copyright 2017 Olaf Wintermann. All rights reserved. |
5 * |
5 * |
6 * Redistribution and use in source and binary forms, with or without |
6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions are met: |
7 * modification, are permitted provided that the following conditions are met: |
8 * |
8 * |
9 * 1. Redistributions of source code must retain the above copyright |
9 * 1. Redistributions of source code must retain the above copyright |
344 void add_checkitemnv_widget(GtkWidget *p, int index, UiMenuItemI *item, UiObject *obj) { |
344 void add_checkitemnv_widget(GtkWidget *p, int index, UiMenuItemI *item, UiObject *obj) { |
345 UiCheckItemNV *ci = (UiCheckItemNV*)item; |
345 UiCheckItemNV *ci = (UiCheckItemNV*)item; |
346 GtkWidget *widget = gtk_check_menu_item_new_with_mnemonic(ci->label); |
346 GtkWidget *widget = gtk_check_menu_item_new_with_mnemonic(ci->label); |
347 gtk_menu_shell_append(GTK_MENU_SHELL(p), widget); |
347 gtk_menu_shell_append(GTK_MENU_SHELL(p), widget); |
348 |
348 |
349 UiVar *var = uic_connect_var(obj->ctx, ci->varname, UI_VAR_INTEGER); |
349 UiVar *var = uic_create_var(obj->ctx, ci->varname, UI_VAR_INTEGER); |
350 if(var) { |
350 if(var) { |
351 UiInteger *value = var->value; |
351 UiInteger *value = var->value; |
352 value->obj = widget; |
352 value->obj = widget; |
353 value->get = ui_checkitem_get; |
353 value->get = ui_checkitem_get; |
354 value->set = ui_checkitem_set; |
354 value->set = ui_checkitem_set; |