diff options
| author | dannye <33dannye@gmail.com> | 2024-11-28 16:14:07 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-28 23:14:07 +0100 |
| commit | 404411ea68e978bab159bd29dc85a02256144e7b (patch) | |
| tree | 9c2ee4c1dc958445ed969668a89774237f6d9188 /src/Fl_Button.cxx | |
| parent | 0cd048a7a848b6aca78ab6176d3e144356512282 (diff) | |
Fix changed flag for radio buttons (#1146)
Diffstat (limited to 'src/Fl_Button.cxx')
| -rw-r--r-- | src/Fl_Button.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Fl_Button.cxx b/src/Fl_Button.cxx index 4df8626c6..05f0fad4c 100644 --- a/src/Fl_Button.cxx +++ b/src/Fl_Button.cxx @@ -131,10 +131,13 @@ int Fl_Button::handle(int event) { if (when() & FL_WHEN_NOT_CHANGED) do_callback(FL_REASON_SELECTED); return 1; } - set_changed(); - if (type() == FL_RADIO_BUTTON) setonly(); - else if (type() == FL_TOGGLE_BUTTON) oldval = value_; - else { + if (type() == FL_RADIO_BUTTON) { + setonly(); + set_changed(); + } else if (type() == FL_TOGGLE_BUTTON) { + oldval = value_; + set_changed(); + } else { value(oldval); set_changed(); if (when() & FL_WHEN_CHANGED) { |
