Without modifying anything, maybe you could use a ListCtrl with one
column and no header?
···
-----Original Message-----
From: lipid@68k.org [mailto:lipid@68k.org]
Sent: Thursday, February 12, 2004 7:11 AM
To: wxpython-users@lists.wxwindows.org
Subject: [wxPython-users] OwnerDrawn wxListBox
I've been wanting to have colored text in a list box for a while now,
and I recently noticed the ownerDrawn sample in wxWindows does just
that. So I added the functionality by modifying the wxPython source,
adding this in controls.i in the %addmethods section of wxListBox:
---
PyObject* SetTextColour(int item, int r, int g, int b) {
self->GetItem(item)->SetTextColour(wxColor(r, g, b));
return Py_None;
}
PyObject* SetBackgroundColour(int item, int r, int g, int b) {
self->GetItem(item)->SetBackgroundColour(wxColor(r, g, b));
return Py_None;
}
---
And it works! Though I understand this method only works on Windows.
And you must add wxLB_OWNERDRAW to the listbox's style flags.
My questions:
1. Is there some way to do this already without modifying the wxPython
source?
2. If not, might a future version allow it?
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org