Hi. As part of my work I've run into what seems to be a potential infinite loop in the Widget::getNextKeyboardNavigableWidget function.
|
while( nextWidget && !nextWidget->isKeyboardNavigable() ) |
The problem seems to be that the two widgets register each other as their next widget so the code just loops back and forth between the two. In this scenario, I have a list of buttons representing combat moves. I also create a panel (Colibri::Renderable) to sit ontop of the button to represent cooldown. Seems the panel and the button register themselves as their next widgets. When the button is pressed it disables itself as part of the callback and the panel is set visible to perform the animation.
This loop is fairly rare as I haven't taken the time to dig further into it, but I imagine it relates to how I animate my cover panels. I'm wondering if something can be done to this while loop regardless to prevent it from potentially hanging like this? Perhaps add some extra exit cases?
Hi. As part of my work I've run into what seems to be a potential infinite loop in the
Widget::getNextKeyboardNavigableWidgetfunction.colibrigui/src/ColibriGui/ColibriWidget.cpp
Line 108 in 022089c
The problem seems to be that the two widgets register each other as their next widget so the code just loops back and forth between the two. In this scenario, I have a list of buttons representing combat moves. I also create a panel (Colibri::Renderable) to sit ontop of the button to represent cooldown. Seems the panel and the button register themselves as their next widgets. When the button is pressed it disables itself as part of the callback and the panel is set visible to perform the animation.
This loop is fairly rare as I haven't taken the time to dig further into it, but I imagine it relates to how I animate my cover panels. I'm wondering if something can be done to this while loop regardless to prevent it from potentially hanging like this? Perhaps add some extra exit cases?