c - Change the value of spin button -
i'm making gtk2 application scratch using glade3 , own main c file.
scenario this. there's collection of 3 spin buttons. need change value of 3rd spin button in real time when value in spin button 1 or 2 changes.
with glade3 i've made 3 spin buttons , know how read values when changing following handler.
void value_calc(gtkspinbutton *o, gpointer d) { gdouble x = gtk_spin_button_get_value (o); printf("spin-button1-vlaue: %f\n", x); }
i connected "change value" signal of 1st spin button above value_calc
handler. printing changed values. i've done same thing 2nd spin button. have 2 values , need update value of 3rd spin button.
void set_values (gdouble value_to_be_added) { gtkspinbutton *spinbuton_3; gtk_spin_button_set_value (spinbuton_3, value_to_be_added); }
when compiling above no errors , warnings. when run program , changing values of spin buttons, error throws command line.
gtk-critical **: ia__gtk_spin_button_set_value: assertion 'gtk_is_spin_button (spin_button)' failed
also doesn't perform required action.
Comments
Post a Comment