//Callback for the bytespersecond values changed G_MODULE_EXPORT void cb_Exposure_changed( GtkEditable *editable, gpointer data ) { gtk_spin_button_update (GTK_SPIN_BUTTON(camera_params.objects->Exp_time)); gtk_spin_button_update (GTK_SPIN_BUTTON(camera_params.objects->Exp_gain)); if(camera_params.type == CAMERA_GIGE) //We set the exposure dynamically only for GiGE Cameras. Andors fails camera_set_exposure(&camera_params); }
static update_dates(gpointer data) { guint year = ((NEW_DATA *) data)->newrun->year; guint month = ((NEW_DATA *) data)->newrun->month; gchar month_str[3]; g_snprintf(month_str, 3, "%i", month); guint day = ((NEW_DATA *) data)->newrun->day; GtkCalendar *calendar = ((NEW_DATA*) data)->calendar; GtkSpinButton *day_chooser = ((NEW_DATA*) data)->day_chooser; GtkComboBoxText *month_chooser = ((NEW_DATA*) data)->month_chooser; GtkSpinButton *year_chooser = ((NEW_DATA*) data)->year_chooser; gtk_spin_button_set_value(GTK_SPIN_BUTTON(day_chooser), day); gtk_spin_button_update(day_chooser); gtk_combo_box_set_active_id(GTK_COMBO_BOX(month_chooser), month_str); gtk_spin_button_set_value(GTK_SPIN_BUTTON(year_chooser), year); gtk_spin_button_update(year_chooser); gtk_calendar_select_day(GTK_CALENDAR(calendar), day); gtk_calendar_select_month(GTK_CALENDAR(calendar), month, year); //printf("%i/%i/%i\n", month, day, year); }
//Callback for the ROI values changed G_MODULE_EXPORT void cb_ROI_changed( GtkEditable *editable, gpointer data ) { //we force the update of the spin button gtk_spin_button_update (GTK_SPIN_BUTTON(camera_params.objects->ROI_height)); gtk_spin_button_update (GTK_SPIN_BUTTON(camera_params.objects->ROI_width)); gtk_spin_button_update (GTK_SPIN_BUTTON(camera_params.objects->ROI_start_x)); gtk_spin_button_update (GTK_SPIN_BUTTON(camera_params.objects->ROI_start_y)); if(camera_params.roi_hard_active) camera_update_roi(&camera_params); }
static gboolean callback(GtkWidget *widget, GdkEventFocus *event, gpointer data) { SpinButtonUpdater* updater = static_cast<SpinButtonUpdater*>(data); gtk_spin_button_update(GTK_SPIN_BUTTON(widget)); updater->update(GTK_SPIN_BUTTON(widget)); return FALSE; }
static void spinbutton_changed_cb (GtkWidget *widget, gpointer user_data) { gtk_spin_button_update (GTK_SPIN_BUTTON (widget)); stuff_changed_cb (widget, user_data); }
int wxSpinCtrl::GetValue() const { wxCHECK_MSG( (m_widget != NULL), 0, wxT("invalid spin button") ); gtk_spin_button_update( GTK_SPIN_BUTTON(m_widget) ); return (int)ceil(m_adjust->value); }
/* GTK+ has an annoying "feature" (I tend to consider it a bug): if * you activate a button from keyboard (i.e. Alt+O for "OK" button), * then keyboard changes in the currently focused spin button are not * saved. This might be true for some other widgets too. * * Every dialog with spin buttons should call this function from all * button/response handlers. */ void gtk_utils_workaround_focus_bug (GtkWindow *window) { GtkWidget *focused_widget = gtk_window_get_focus (window); if (focused_widget) { if (GTK_IS_SPIN_BUTTON (focused_widget)) gtk_spin_button_update (GTK_SPIN_BUTTON (focused_widget)); } }
G_MODULE_EXPORT void on_spinbutton2_activate (GtkEntry *entry, gpointer user_data) { #ifdef DEBUG printf("on_spinbutton2_activate\n"); #endif gtk_spin_button_update(GTK_SPIN_BUTTON(lookup_widget(window.digits, "spinbutton2"))); on_button_digits_ok_clicked(NULL, NULL); }
/* Refreshes a spin button. The behaviour of the update is * determined by gtk_spin_button_set_update_policy(). */ int clip_GTK_SPINBUTTONUPDATE(ClipMachine * ClipMachineMemory) { C_widget *cspb = _fetch_cw_arg(ClipMachineMemory); CHECKCWID(cspb, GTK_IS_SPIN_BUTTON); gtk_spin_button_update(GTK_SPIN_BUTTON(cspb->widget)); return 0; err: return 1; }
/** * ag_chart_edit_update: * @chart_edit: an #AgChartEdit * * If the current widget is a spin button, force it to update. This is * required when the user enters a new value in a spin button, but * doesn't leave the spin entry before switching tabs with an accel. */ void ag_chart_edit_update(AgChartEdit *chart_edit) { GtkWidget *current; GtkWindow *window = GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(chart_edit))); current = gtk_window_get_focus(window); if (GTK_IS_SPIN_BUTTON(current)) { gtk_spin_button_update(GTK_SPIN_BUTTON(current)); } }
static void dialog_clock_settings_changed_cb (GSettings *settings_display, gchar *key, CcNightLightDialog *self) { self->clock_format = g_settings_get_enum (settings_display, CLOCK_FORMAT_KEY); /* uncontionally widen this to avoid truncation */ gtk_adjustment_set_lower (self->adjustment_from_hours, 0); gtk_adjustment_set_upper (self->adjustment_from_hours, 23); gtk_adjustment_set_lower (self->adjustment_to_hours, 0); gtk_adjustment_set_upper (self->adjustment_to_hours, 23); /* update spinbuttons */ gtk_spin_button_update (GTK_SPIN_BUTTON (self->spinbutton_from_hours)); gtk_spin_button_update (GTK_SPIN_BUTTON (self->spinbutton_to_hours)); /* update UI */ dialog_update_state (self); dialog_update_adjustments (self); }
static VALUE rg_update(VALUE self) { gtk_spin_button_update(_SELF(self)); return self; }
void set_spin_btn_value(GtkSpinButton** obj, double value) { gtk_spin_button_set_value(*obj, value); gtk_spin_button_update(*obj); }
void SpinOptionView::_onAccept() const { gtk_spin_button_update(GTK_SPIN_BUTTON(mySpinBox)); ((ZLSpinOptionEntry&)*myOption).onAccept((int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(mySpinBox))); }
gint prefs_apply( GtkWidget *widget, GdkEvent *event, gpointer data ) { int i, type; char txt[64]; for ( i=0; i<STATUS_ITEMS; i++ ) { sprintf(txt, "status%iToggle", i); inifile_set_gboolean( txt, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(prefs_status[i])) ); status_on[i] = inifile_get_gboolean(txt, TRUE); } gtk_spin_button_update( GTK_SPIN_BUTTON(spinbutton_maxmem) ); gtk_spin_button_update( GTK_SPIN_BUTTON(spinbutton_greys) ); gtk_spin_button_update( GTK_SPIN_BUTTON(spinbutton_nudge) ); gtk_spin_button_update( GTK_SPIN_BUTTON(spinbutton_trans) ); gtk_spin_button_update( GTK_SPIN_BUTTON(spinbutton_hotx) ); gtk_spin_button_update( GTK_SPIN_BUTTON(spinbutton_hoty) ); gtk_spin_button_update( GTK_SPIN_BUTTON(spinbutton_jpeg) ); gtk_spin_button_update( GTK_SPIN_BUTTON(spinbutton_recent) ); gtk_spin_button_update( GTK_SPIN_BUTTON(spinbutton_pan) ); for ( i=0; i<4; i++ ) gtk_spin_button_update( GTK_SPIN_BUTTON(spinbutton_grid[i]) ); // All needed in GTK+2 for late changes mem_undo_limit = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON(spinbutton_maxmem) ); mem_background = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON(spinbutton_greys) ); mem_nudge = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON(spinbutton_nudge) ); mem_xpm_trans = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON(spinbutton_trans) ); mem_xbm_hot_x = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON(spinbutton_hotx) ); mem_xbm_hot_y = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON(spinbutton_hoty) ); mem_jpeg_quality = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON(spinbutton_jpeg) ); recent_files = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON(spinbutton_recent) ); mem_grid_min = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON(spinbutton_grid[0]) ); for ( i=0; i<3; i++ ) mem_grid_rgb[i] = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON(spinbutton_grid[i+1]) ); for ( i=0; i<3; i++ ) { tablet_tool_use[i] = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check_tablet[i])); inifile_set_gboolean( tablet_ini2[i], tablet_tool_use[i] ); tablet_tool_factor[i] = GTK_HSCALE(hscale_tablet[i])->scale.range.adjustment->value; inifile_set_gint32( tablet_ini[i], tablet_tool_factor[i]*100 ); } inifile_set_gint32( "gridMin", mem_grid_min ); inifile_set_gint32( "gridR", mem_grid_rgb[0] ); inifile_set_gint32( "gridG", mem_grid_rgb[1] ); inifile_set_gint32( "gridB", mem_grid_rgb[2] ); inifile_set_gint32( "panSize", gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON(spinbutton_pan) ) ); inifile_set_gint32( "undoMBlimit", mem_undo_limit ); inifile_set_gint32( "backgroundGrey", mem_background ); inifile_set_gint32( "pixelNudge", mem_nudge ); inifile_set_gint32( "jpegQuality", mem_jpeg_quality ); inifile_set_gint32( "recentFiles", recent_files ); inifile_set_gboolean( "zoomToggle", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbutton_zoom)) ); inifile_set_gboolean( "pasteToggle", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbutton_paste)) ); inifile_set_gboolean( "cursorToggle", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbutton_cursor)) ); inifile_set_gboolean( "exitToggle", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbutton_exit)) ); #if GTK_MAJOR_VERSION == 2 inifile_set_gboolean( "scrollwheelZOOM", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbutton_wheel)) ); #endif inifile_set_gboolean( "pasteCommit", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbutton_commit)) ); q_quit = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbutton_quit)); inifile_set_gboolean( "quitToggle", q_quit ); type = 0; #ifdef U_NLS for ( i=0; i<PREF_LANGS; i++ ) { if ( gtk_toggle_button_get_active( &(GTK_RADIO_BUTTON( pref_lang_radio[i] )->check_button.toggle_button) ) ) type = i; } inifile_set( "languageSETTING", pref_lang_ini[type*2] ); setup_language(); #endif strncpy( mem_clip_file[1], gtk_entry_get_text( GTK_ENTRY(clipboard_entry) ), 250 ); strncpy( mem_clip_file[0], mem_clip_file[1], 250 ); inifile_set( "clipFilename", mem_clip_file[0] ); show_paste = inifile_get_gboolean( "pasteToggle", TRUE ); update_all_views(); // Update canvas for changes set_cursor(); update_recent_files(); init_status_bar(); return FALSE; }