dalerank / nanogui-sdl

Minimalistic port of NanoGUI claim works with SDL API w/o external dependencies.
Other
437 stars 77 forks source link

Fix indices of DropDownBox::setSelectedIndex #37

Closed akuskis closed 4 years ago

akuskis commented 4 years ago

Fix indices of DropDownBox::setSelectedIndex. There is additional zero child which is shown on top of the button. This item contains caption of selected item...

So popup().children() returns array of:

  1. header item (show caption of selected option)
  2. option 0
  3. option 1 etc.

that is why +1 is required