Question/suggestion, why two separate functions for binding and setting the callback id?
Why not button->bindCallback(tgui::Button::LeftMouseClicked, 1);
Is there ever a need for separate functions?
Imo the function could even return the callback as integer and make the second parameter (ID) optional, assigning a new unique number if not entered.
Even better would be if the button could somehow be used in the way below
Why not button->bindCallback(tgui::Button::LeftMouseClicked, 1);
Is there ever a need for separate functions?
Imo the function could even return the callback as integer and make the second parameter (ID) optional, assigning a new unique number if not entered.
Even better would be if the button could somehow be used in the way below
Code Select
//Handle callbacks
while (m_gui.pollCallback(m_callback))
{
if (quitbutton.state == tgui::Button::LeftMouseClicked)
{
Shutdown();
}
}