Skip to content

Commit

Permalink
GUI2/Toggle Button: fire NOTIFY_MODIFIED when setting value
Browse files Browse the repository at this point in the history
This matches other widget such as the toggle_panel.
  • Loading branch information
Vultraz committed Aug 25, 2017
1 parent 774e4cc commit 85ed8a8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/gui/widgets/toggle_button.cpp
Expand Up @@ -121,7 +121,15 @@ void toggle_button::set_value(const unsigned selected)

// Check for get_window() is here to prevent the callback from
// being called when the initial value is set.
if(callback_state_change_ && get_window() != nullptr) {
//
// TODO: see if this is necessary with the signal handler.
if(!get_window()) {
return;
}

fire(event::NOTIFY_MODIFIED, *this, nullptr);

if(callback_state_change_) {
callback_state_change_(*this);
}
}
Expand Down

0 comments on commit 85ed8a8

Please sign in to comment.