- m_clientDataList.Append ((long) i, (wxObject *) clientData[i]);
-
- XmListAddItems (listBox, text, n, 0);
- for (i = 0; i < n; i++)
- XmStringFree (text[i]);
- delete[]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);
+ text[i] = XmStringCreateSimple ((char*) (const char*) choices[i]);
+
+ if ( clientData )
+ for (i = 0; i < n; i++)
+ m_clientDataList.Append ((long) i, (wxObject *) clientData[i]);
+
+ XmListAddItems (listBox, text, n, 0);
+ for (i = 0; i < n; i++)
+ XmStringFree (text[i]);
+ delete[]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);