-int wxListBox::DoAppend(const wxString& item)
-{
- wxSizeKeeper sk( this );
- Widget listBox = (Widget) m_mainWidget;
-
- bool managed = XtIsManaged(listBox);
-
- if (managed)
- XtUnmanageChild (listBox);
- int n;
- XtVaGetValues (listBox, XmNitemCount, &n, NULL);
- wxXmString text( item );
- // XmListAddItem(listBox, text, n + 1);
- XmListAddItemUnselected (listBox, text(), 0);
-
- // It seems that if the list is cleared, we must re-ask for
- // selection policy!!
- SetSelectionPolicy();
-
- if (managed)
- XtManageChild (listBox);
-
- sk.Restore();
- m_noItems ++;
-
- return GetCount() - 1;
-}
-
-void wxListBox::DoSetItems(const wxArrayString& items, void** clientData)
-{
- wxSizeKeeper sk( this );
- Widget listBox = (Widget) m_mainWidget;
-
- if( HasClientObjectData() )
- m_clientDataDict.DestroyData();
-
- bool managed = XtIsManaged(listBox);
-
- if (managed)
- XtUnmanageChild (listBox);
- XmString *text = new XmString[items.GetCount()];
- unsigned int i;
- for (i = 0; i < items.GetCount(); ++i)
- text[i] = wxStringToXmString (items[i]);
-
- if ( clientData )
- for (i = 0; i < items.GetCount(); ++i)
- m_clientDataDict.Set(i, (wxClientData*)clientData[i], false);
-
- XmListAddItems (listBox, text, items.GetCount(), 0);
- for (i = 0; i < items.GetCount(); i++)
- XmStringFree (text[i]);
- delete[] text;
-
- // It seems that if the list is cleared, we must re-ask for
- // selection policy!!
- SetSelectionPolicy();
-
- if (managed)
- XtManageChild (listBox);
-
- sk.Restore();
-
- m_noItems = items.GetCount();
-}
-