if (m_widgetList)
delete[] m_widgetList;
- DetachWidget(GetMainWidget()); // Removes event handlers
+ if (GetMainWidget())
+ {
+ DetachWidget(GetMainWidget()); // Removes event handlers
- XtDestroyWidget((Widget) m_formWidget);
- m_formWidget = (WXWidget) 0;
+ XtDestroyWidget((Widget) m_formWidget);
+ m_formWidget = (WXWidget) 0;
- // Presumably the other widgets have been deleted now, via the form
- m_mainWidget = (WXWidget) 0;
- m_buttonWidget = (WXWidget) 0;
+ // Presumably the other widgets have been deleted now, via the form
+ m_mainWidget = (WXWidget) 0;
+ m_buttonWidget = (WXWidget) 0;
+ }
}
void wxChoice::Append(const wxString& item)
XtVaGetValues (w, XmNuserData, &s, NULL);
if (s)
{
- wxCommandEvent event (wxEVT_COMMAND_CHOICE_SELECTED);
+ wxCommandEvent event (wxEVT_COMMAND_CHOICE_SELECTED, item->GetId());
+ event.SetEventObject(item);
event.m_commandInt = item->FindString (s);
// event.m_commandString = s;
item->ProcessCommand (event);