[wx-dev] Re: wxListBox::SetStringSelection behaviour
Vadim Zeitlin
vadim at wxwindows.org
Mon Jul 3 17:31:10 PDT 2006
On Mon, 03 Jul 2006 13:55:42 +0200 Francesco Montorsi <f18m_cpp217828 at yahoo.it> wrote:
FM> Vadim Zeitlin ha scritto:
FM> > On Sun, 2 Jul 2006 15:29:33 +0000 (UTC) Francesco Montorsi <f18m_cpp217828 at yahoo.it> wrote:
FM> >
FM> > FM> I've found that using
FM> > FM> wxListBox::SetStringSelection(wxT("string-not-in-the-listbox")); always causes
FM> > FM> an assert.
FM> > FM> Since SetStringSelection returns a bool indicating the success/failure of the
FM> > FM> operation, I think that the following patch should be applied:
FM> >
FM> > This has been asked for in the past
Actually I was probably wrong with this. I think now it was asked about
the same method in wxControlWithItems and the assert was indeed removed
from there. So I guess we need to remove it from wxListBox as well -- done
now.
FM> > I'm pretty sure that any bug accidentally resulting in this call
FM> > would be much harder to find without the assert.
FM> I don't think as the documentation currently clearly says:
FM> "Return value = true if the specified string has been selected, false if
FM> it wasn't found in the control."
This helped to convince me too, thanks,
VZ
More information about the wx-dev
mailing list