- m_listCtrl->InsertColumn(0, "Column 1"); // , wxLIST_FORMAT_LEFT, 140);
- m_listCtrl->InsertColumn(1, "Column 2"); // , wxLIST_FORMAT_LEFT, 140);
- m_listCtrl->InsertColumn(2, "One More Column (2)"); // , wxLIST_FORMAT_LEFT, 140);
+ // under MSW for SetColumnWidth() to work we need to create the items with
+ // images initially
+#if 1
+ wxListItem itemCol;
+ itemCol.m_mask = wxLIST_MASK_TEXT | wxLIST_MASK_IMAGE;
+ itemCol.m_text = _T("Column 1");
+ itemCol.m_image = -1;
+ m_listCtrl->InsertColumn(0, itemCol);
+ itemCol.m_text = _T("Column 2");
+ m_listCtrl->InsertColumn(1, itemCol);
+ itemCol.m_text = _T("Column 3");
+ m_listCtrl->InsertColumn(2, itemCol);
+#else
+ m_listCtrl->InsertColumn(0, _T("Column 1")); // , wxLIST_FORMAT_LEFT, 140);
+ m_listCtrl->InsertColumn(1, _T("Column 2")); // , wxLIST_FORMAT_LEFT, 140);
+ m_listCtrl->InsertColumn(2, _T("One More Column (2)")); // , wxLIST_FORMAT_LEFT, 140);
+#endif