I am able to get this to work with following work around. It would have been nice if there is a neater solution that does not involve timers.
void CMainWindow::SetGuidance(const Glib::ustring &sGuidance)
{
/*
* Unit Name :
* Unit ID : U-MainWindow.cpp-
* Author : mohith (10-Mar-2020, 3:21:18 pm)
* Comments (if any)
*/
{
m_oLabelGuidance.get_style_context()->remove_class(IDU_CSS_CLASS_BLINK_WIDGET);
m_connGuidanceDisplay.disconnect();
m_oLabelGuidance.set_text(sGuidance);
m_connGuidanceDisplay =
Glib::signal_timeout().connect(sigc::bind(sigc::mem_fun(*this,
&CMainWindow::UpdateGuidance),
true),
50);
}
}
bool CMainWindow::UpdateGuidance(bool bShow)
{
/*
* Unit Name :
* Unit ID : U-MainWindow.cpp-
* Author : mohith (10-Mar-2020, 3:18:55 pm)
* Comments (if any)
*/
{
if (true
== bShow)
{
m_oLabelGuidance.get_style_context()->add_class(IDU_CSS_CLASS_BLINK_WIDGET);
m_connGuidanceDisplay =
Glib::signal_timeout().connect_seconds(sigc::bind(sigc::mem_fun(*this,
&CMainWindow::UpdateGuidance),
false),
5);
} else
{
m_oLabelGuidance.set_text("");
}
}
return 0;
}
Would still help if someone has a better idea.