diff options
| -rw-r--r-- | FL/Fl_Input_Choice.H | 7 | ||||
| -rw-r--r-- | test/input_choice.cxx | 4 |
2 files changed, 11 insertions, 0 deletions
diff --git a/FL/Fl_Input_Choice.H b/FL/Fl_Input_Choice.H index 45971bc4b..ce228b780 100644 --- a/FL/Fl_Input_Choice.H +++ b/FL/Fl_Input_Choice.H @@ -62,6 +62,7 @@ class Fl_Input_Choice : public Fl_Group { const Fl_Menu_Item *item = o->menubutton()->mvalue(); if ( item && item->flags & (FL_SUBMENU|FL_SUBMENU_POINTER) ) return; // ignore submenus o->inp_->value(o->menu_->text()); + o->inp_->set_changed(); o->do_callback(); } @@ -101,6 +102,12 @@ public: int changed() const { return inp_->changed(); } + void clear_changed() { + return inp_->clear_changed(); + } + void set_changed() { + return inp_->set_changed(); + } void clear() { menu_->clear(); } diff --git a/test/input_choice.cxx b/test/input_choice.cxx index 6f7471330..80cce18a2 100644 --- a/test/input_choice.cxx +++ b/test/input_choice.cxx @@ -32,6 +32,10 @@ void buttcb(Fl_Widget*,void*data) { flag ^= 1; if ( flag ) in->activate(); else in->deactivate(); + if (in->changed()) { + printf("Callback: changed() is set\n"); + in->clear_changed(); + } } void input_choice_cb(Fl_Widget*,void*data) { |
