Export to GitHub

controlp5 - issue #33

ListBox event values are -1 indexed


Posted on Jan 17, 2012 by Massive Camel

What steps will reproduce the problem? if(event.isController() && event.isGroup()){ if(event.name().equals("Something")) { int test = (int)event.group().value()); } }

What is the expected output? What do you see instead? 0 indexed values. Instead values are -1 indexed

What version of the product are you using? On what operating system? 0.5.4 Windows7

Please provide any additional information below. Can be related to previous two issues.

Comment #1

Posted on Jan 18, 2012 by Happy Rhino

this condition should never be met, an event can only be triggered by a controller or a group at separate times but not at the same time.

if(event.isController() && event.isGroup()){ }

Comment #2

Posted on Jan 18, 2012 by Happy Rhino

(No comment was entered for this change.)

Comment #3

Posted on Jan 18, 2012 by Massive Camel

Sorry. I copied wrong.

The expression is ofcourse,

if(event.isGroup() && event.name().equals("Active Tokens")){ int test = (int)event.group().value()); }

Please check for -1 index being returned

Comment #4

Posted on Jan 18, 2012 by Happy Rhino

as of version 0.7.0 if an item of a listbox is triggered, the value of the listbox will correspond to the value of the listboxitem.

Status: Fixed

Labels:
Type-Defect Priority-Medium