[wxPython] simple wxListCtrl questions

Hello,

    I've some questions about the useage of wxListCtrl class. How can I set the background and text colour of the label? I try to insert StringItems in the wxListCtrl. The vertical scrollbar appears, but the inserted items are "invisible". How can I make it visible?

Here is the section of my application:

···

-------------------------------------------------
buildings = wxListCtrl(panel, 60, wxPoint(30, 10), wxSize(220, 100), style=wxLC_SINGLE_SEL|wxLC_REPORT)
buildings.SetColumnWidth(0, 220)
       build_lab = wxListItem()
build_lab.m_mask = wxLIST_MASK_TEXT
build_lab.m_format = wxLIST_FORMAT_LEFT
build_lab.m_text = "Buildings"
buildings.InsertColumnInfo(0, build_lab)

test_list = ["Build_1", "Build_2", "Build_3", "Build_4", "Build_5", "Build_6", "Build_7"]
map((lambda x: buildings.InsertStringItem(alap_list.index(x), x)), test_list)

-----------------------------------------------------------------------------------------------------------------------
System: Debian Woody, Python 2.2, wxPython 2.3.3.1

    Thank you in advance,

                            Peter

See the wiki on list and tree controls Hello World section, note the use of InsertColumn in particular.

http://wiki.wxpython.org/index.cgi/ListAndTreeControls

HTH,
Mike

Ábrahám Péter wrote:

···

Hello,

   I've some questions about the useage of wxListCtrl class. How can I set the background and text colour of the label? I try to insert StringItems in the wxListCtrl. The vertical scrollbar appears, but the inserted items are "invisible". How can I make it visible?

Here is the section of my application:
-------------------------------------------------
buildings = wxListCtrl(panel, 60, wxPoint(30, 10), wxSize(220, 100), style=wxLC_SINGLE_SEL|wxLC_REPORT)
buildings.SetColumnWidth(0, 220)
      build_lab = wxListItem()
build_lab.m_mask = wxLIST_MASK_TEXT
build_lab.m_format = wxLIST_FORMAT_LEFT
build_lab.m_text = "Buildings"
buildings.InsertColumnInfo(0, build_lab)

test_list = ["Build_1", "Build_2", "Build_3", "Build_4", "Build_5", "Build_6", "Build_7"]
map((lambda x: buildings.InsertStringItem(alap_list.index(x), x)), test_list)

-----------------------------------------------------------------------------------------------------------------------

System: Debian Woody, Python 2.2, wxPython 2.3.3.1

   Thank you in advance,

                           Peter

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users

--
_______________________________________
   Mike C. Fletcher
   Designer, VR Plumber, Coder
   http://members.rogers.com/mcfletch/