wxlistctrl SetItemBackgroundColour problems

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
broadken
In need of some credit
In need of some credit
Posts: 3
Joined: Fri Dec 30, 2005 4:27 am

wxlistctrl SetItemBackgroundColour problems

Post by broadken » Sat Jan 21, 2006 9:02 pm

1.

Code: Select all

wxListCtrl * Listctrl=new wxListCtrl(this,ID_WXLISTCtrl1,wxPoint(8,8),wxDefaultSize,wxLC_LIST|wxLC_SINGLE_SEL);
    long temp=Listctrl->InsertItem(0,"hello1",0);
    Listctrl->SetItemBackgroundColour(temp,wxColour(255, 0, 0));
It turns out the the red color only covers the text, not in the whole row in the wxListCtrl.
can anyone help me that?

2.anothe problem is that :
can I set only one column in this wxListctrl?

Bundy
I live to help wx-kind
I live to help wx-kind
Posts: 153
Joined: Fri Apr 29, 2005 9:46 am
Location: Poland

Post by Bundy » Mon Jan 23, 2006 1:37 pm

To set another column use:

Code: Select all

WxListCtrl1 =  new wxListCtrl(strona1, ID_WXLISTCTRL1,wxDefaultPosition,wxSize(300,-1), wxLC_REPORT | wxLC_SINGLE_SEL);//wxPoint(25,85+50)

WxListCtrl1->InsertColumn(0,_("Port"),wxLIST_FORMAT_LEFT,-1 );
WxListCtrl1->InsertColumn(0,_("IP address"),wxLIST_FORMAT_LEFT,-1 );

and put data:

Code: Select all

WxListCtrl1->InsertItem(y,"col1");
WxListCtrl1->SetItem(y,1,"col2",-1);
where y is a row number. In SetItem() second parameter is a col number


regards
Bundy
"Fate rewards prepared mind"

Quote from movie "Liberator 2"

Post Reply