void set_properties(ChartInstance *ci) { struct buysell_data *data=(struct buysell_data *)ci->instance_data; GnomePropertyBox *pbox; GladeXML *xxml; xxml=glade_xml_new(BUYSELLGLADE_FILE,"BuySellPropertyBox"); glade_xml_signal_autoconnect(xxml); pbox=(GnomePropertyBox *)glade_xml_get_widget(xxml,"BuySellPropertyBox"); bs_cpick=(GnomeColorPicker *)glade_xml_get_widget(xxml,"BuySellColor"); bs_pricespin=(GtkSpinButton *)glade_xml_get_widget(xxml,"BuySellPrice"); bs_numstocks=(GtkSpinButton *)glade_xml_get_widget(xxml,"NumStocks"); bs_date=(GnomeDateEdit *)glade_xml_get_widget(xxml,"Date"); bs_buybotton=(GtkWidget *)glade_xml_get_widget(xxml,"BuyButton"); bs_sellbutton=(GtkWidget *)glade_xml_get_widget(xxml,"SellButton"); //Hack away the "apply" button gtk_widget_hide(GNOME_PROPERTY_BOX(pbox)->apply_button); gnome_property_box_changed(pbox); //Necessary, or the callback won't be called gnome_color_picker_set_i8(bs_cpick,data->r,data->g,data->b,data->a); gtk_spin_button_set_value(bs_pricespin,data->price); gtk_spin_button_set_value(bs_numstocks,data->amount); gnome_date_edit_set_time(bs_date,data->time); if (data->buy) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(bs_buybotton),TRUE); else gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(bs_sellbutton),TRUE); bs_global_ci=ci; gnome_dialog_run(GNOME_DIALOG(pbox)); }
void handle_global_checkbox_toggled (GtkToggleButton *togglebutton, gpointer data) { if (get_game_state () != GAME_NOT_RUNNING) { GtkWidget *frame; frame = glade_xml_get_widget (pref_xml, "frame_mouse_props"); gtk_widget_set_sensitive (GTK_WIDGET (frame), FALSE); g_signal_handlers_disconnect_by_func (togglebutton, G_CALLBACK (handle_global_checkbox_toggled), data); gtk_toggle_button_set_active (togglebutton, !gtk_toggle_button_get_active (togglebutton)); } else { gnome_property_box_changed (GNOME_PROPERTY_BOX (data)); } }
void handle_mouse_ctrl_toggled (GtkToggleButton *togglebutton, gpointer data) { GtkWidget *frame; /* get widgets */ frame = glade_xml_get_widget (pref_xml, "frame_mouse_props"); /* set status of property box */ gnome_property_box_changed (GNOME_PROPERTY_BOX (data)); /* enable/disable mouse control properties */ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (togglebutton))) { gtk_widget_set_sensitive (frame, TRUE); } else { gtk_widget_set_sensitive (frame, FALSE); } }
static void wrapper (void * gobj, void * data) { gnome_property_box_changed (GNOME_PROPERTY_BOX(data)); }
void handle_widget_changed (GtkWidget *widget, gpointer data) { gnome_property_box_changed (GNOME_PROPERTY_BOX (data)); }