diff --git a/src/motif/combobox_native.cpp b/src/motif/combobox_native.cpp index 9a96177941..498ce2565f 100644 --- a/src/motif/combobox_native.cpp +++ b/src/motif/combobox_native.cpp @@ -229,18 +229,17 @@ void wxComboBox::Clear() void wxComboBox::SetSelection (int n) { -#ifdef LESSTIF_VERSION +#if wxCHECK_LESSTIF() XmListSelectPos (GetXmList(this), n + 1, false); SetValue(GetString(n)); #else +#if 0 wxXmString str( GetString(n).c_str() ); XmComboBoxSelectItem((Widget) m_mainWidget, str()); -#if 0 - // does it work for Motif - XtVaSetValues( (Widget)m_mainWidget, - XmNselectedPosition, n + 1, - NULL ); #endif + XtVaSetValues( (Widget)m_mainWidget, + XmNselectedPosition, n, + NULL ); #endif } diff --git a/src/motif/listbox.cpp b/src/motif/listbox.cpp index dc8cf4c10a..db682d40d4 100644 --- a/src/motif/listbox.cpp +++ b/src/motif/listbox.cpp @@ -459,7 +459,7 @@ wxString wxDoGetStringInList( Widget listBox, int n ) XmNitemCount, &count, XmNitems, &strlist, NULL ); - if( n <= count && n >= 0 ) + if( n < count && n >= 0 ) return wxXmStringToString( strlist[n] ); else return wxEmptyString;