ComboBox::getItemIndex warnings
« on: 17 March 2015, 13:17:11 »
Hi,

I'm using TGUI, it's very nice to work with so thanks very much for publishing it.

I'm using a ComboBox that changes its contents regularly, and when its contents include a certain string, it needs to give me its index.
However, when the combobox doesn't have this string, it should just do nothing. So my code looks like:

Code: [Select]
if (combobox_->getItemIndex(preferred_item) != -1) {
   // ..
}

However, my console displays a warning now: "TGUI warning: The name didn't match any item. Returning -1 as item index."
Since the returning of -1 is expected behaviour (according to the documentation), I don't want this warning. Is there a way to disable these warnings?

« Last Edit: 17 March 2015, 13:19:58 by BasV »

*

texus

  • *****
  • 1143
    • View Profile
    • Texus's Blog
Re: ComboBox::getItemIndex warnings
« Reply #1 on: 17 March 2015, 14:27:05 »
There is no way to disable it, but I don't think these warnings are really needed. So I just removed them.

You can download the new version on github. You will have to build the libraries yourself with cmake.

Re: ComboBox::getItemIndex warnings
« Reply #2 on: 17 March 2015, 16:24:45 »
Nice, thank you very much!