I’m using following construction for progress_fraction
animation:
// Animate progress function
Glib::signal_timeout().connect(
[this]() -> bool
{
double current_progress_fraction = get_progress_fraction();
// Animation in progress
if (current_progress_fraction < progress_fraction)
{
set_progress_fraction(
current_progress_fraction + PROGRESS_PULSE_STEP
);
return true; // continue
}
// 100% of value, reset
set_progress_fraction(
progress_fraction = 0
);
return false; // stop
},
PROGRESS_ANIMATION_TIME
);
But when activate new action before current Glib::signal_timeout
completed, progress animation going wrong.
How can I stop Glib::signal_timeout
before activating new one?