-}
-
-void wxListBox::Append(const wxString& item, void *clientData)
-{
- int width1, height1;
- int width2, height2;
-
- Widget listBox = (Widget) m_mainWidget;
-
- GetSize (&width1, &height1);
- Bool managed = XtIsManaged(listBox);
-
- if (managed)
- XtUnmanageChild (listBox);
-
- int n;
- XtVaGetValues (listBox, XmNitemCount, &n, NULL);
- XmString text = XmStringCreateSimple ((char*) (const char*) item);
- // XmListAddItem(listBox, text, n + 1);
- XmListAddItemUnselected (listBox, text, 0);
- XmStringFree (text);
-
- // It seems that if the list is cleared, we must re-ask for
- // selection policy!!
- Arg args[3];
- XtSetArg (args[0], XmNlistSizePolicy, XmCONSTANT);
- if (m_windowStyle & wxLB_MULTIPLE)
- XtSetArg (args[1], XmNselectionPolicy, XmMULTIPLE_SELECT);
- else if (m_windowStyle & wxLB_EXTENDED)
- XtSetArg (args[1], XmNselectionPolicy, XmEXTENDED_SELECT);
- else
- XtSetArg (args[1], XmNselectionPolicy, XmBROWSE_SELECT);
- XtSetValues (listBox, args, 2);
-
- m_clientDataList.Append ((long) n, (wxObject *) clientData);
-
- if (managed)
- XtManageChild (listBox);