Jump to content

Assertion passing focus to WidgetTreeBox


photo

Recommended Posts

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
×
×
  • Create New...