ivan.cuevas Posted September 28, 2010 Share Posted September 28, 2010 Hi all, I'm defining a user interface with a WidgetTreeBox, because of user interaction a method is called and the tree must be cleared (no object 3d intersected) and the focus passed to it. The problem is that an exception arises when tree.setFocus() is invoked: 09:48:00 D:\Unigine\source\engine\utils\Vector.h:125: Assertion: 'index >= 0 && (Counter)index < length && "Vector::operator[](): bad index" I tried two different conditionals and these were the results: tree.clear(); //assertion tree.setFocus(); //assertion if(!tree.isFocused()) tree.setFocus(); //Ok if(tree.getNumItems() > 0) tree.setFocus(); Unigine version is "Binary: Windows 32bit Visual C++ 1600 Debug Sep 6 2010" Why a WidgetTreeBox without items can be focused? Thanks in advance, Iván. Link to comment
void Posted September 28, 2010 Share Posted September 28, 2010 Try tree.clear(); tree.setCurrentItem(-1); Link to comment
ivan.cuevas Posted September 28, 2010 Author Share Posted September 28, 2010 Try tree.clear(); tree.setCurrentItem(-1); I see the reason, but, should WidgetTreeBox reset the current item at clear method? Link to comment
Recommended Posts