// This one is an event handler for a SpinButton, used to set the menu Max note count private void UpdateMenuMaxNoteCountPreference(object source, EventArgs args) { Gtk.SpinButton spinner = source as SpinButton; Preferences.Set(Preferences.MENU_MAX_NOTE_COUNT, spinner.ValueAsInt); // We need to update upper limit for menuMinNoteCountSpinner in view of this change double min, max; menuMinNoteCountSpinner.GetRange(out min, out max); menuMinNoteCountSpinner.SetRange(min, spinner.Value); }
void exhibitionSchoolChange(int change) { double newValue = spin_exhibition_school.Value + change; double min, max; spin_exhibition_school.GetRange(out min, out max); if (newValue < min) { spin_exhibition_school.Value = min; } else if (newValue > max) { spin_exhibition_school.Value = max; } else { spin_exhibition_school.Value = newValue; } }