Этот пример - лучший способ для меня вставить столбец.
#include <wx/wx.h>
#include <wx/listctrl.h>
#include <wx/colour.h>
enum { ID_LISTBOOK = 10};
class MyApp:public wxApp {
bool OnInit()
{
if ( !wxApp::OnInit() )
return false;
wxInitAllImageHandlers();
wxFrame* frame = new wxFrame(NULL, wxID_ANY,"wxListCtrl Insert Colored Items");
wxListCtrl* listCtrl = new wxListCtrl(frame,ID_LISTBOOK, wxDefaultPosition, wxDefaultSize, wxLC_REPORT);
listCtrl->InsertColumn(0, "Name", wxLIST_FORMAT_LEFT);
listCtrl->InsertColumn(1, "Number", wxLIST_FORMAT_LEFT);
wxListItem* item = new wxListItem();
item->SetBackgroundColour(*wxRED);
item->SetText(wxT("Programmer"));
item->SetId(0);
listCtrl->InsertItem(0, *item);
listCtrl->InsertItem(1, *item);
listCtrl->InsertItem(2, *item);
listCtrl->InsertItem(3, *item);
listCtrl->SetItem(0,0,wxT("1"), -1);
listCtrl->SetItem(0,1,wxT("1"), -1);
listCtrl->SetItem(1,0,wxT("2"), -1);
listCtrl->SetItem(1,1,wxT("2"), -1);
listCtrl->SetItem(2,0,wxT("3"), -1);
listCtrl->SetItem(2,1,wxT("3"), -1);
listCtrl->SetItem(3,0,wxT("4"), -1);
listCtrl->SetItem(3,1,wxT("4"), -1);
frame->Show(true);
return true;
};
};
IMPLEMENT_APP(MyApp)