ComboBox::getItemIndex warnings

Started by BasV, 17 March 2015, 13:17:11

BasV

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:


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?


texus

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.

BasV