Listctrl Background color (not of items, but the listctrl itself)

Hey there,

Quick question about the listctrl (or ultimatelistctrl).

Say I have a listctrl with enough space for 5 items before our frame is filled and a scrollbar will appear. The listctrl has 3 items in it. The bottom of the listctrl is empty, blank space because we have enough space for 5 items and only filled 3. This blank space is pure white.

Now, resizing the window when the listctrl doesn’t have a full 5 to get rid of that pure whiteness is one option, but it’s one I’d rather avoid if possible. Is it possible to just change the background color of the listctrl item itself (not the specific items in the list ctrl)?

(If you’re having a hard time visualizing my question, let me know and I’ll shop up an image)

As always, thanks for your help.

you can use SetBackgroundColour() to set the back color for the entire control and SetItemBackgroundColour() for the individual items in the list.

···

On Thu, Mar 24, 2011 at 11:42 AM, seanybob seanybob@gmail.com wrote:

Hey there,
Quick question about the listctrl (or ultimatelistctrl).

Say I have a listctrl with enough space for 5 items before our frame is filled and a scrollbar will appear. The listctrl has 3 items in it. The bottom of the listctrl is empty, blank space because we have enough space for 5 items and only filled 3. This blank space is pure white.

Now, resizing the window when the listctrl doesn’t have a full 5 to get rid of that pure whiteness is one option, but it’s one I’d rather avoid if possible. Is it possible to just change the background color of the listctrl item itself (not the specific items in the list ctrl)?

(If you’re having a hard time visualizing my question, let me know and I’ll shop up an image)

As always, thanks for your help.

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

Doh - a simple answer, and works just fine. Thanks mate.

Let me try to raise the stakes a bit and give you a more difficult, related question then.

So here is an image of what I’m looking for:

http://img51.imageshack.us/img51/5041/examplebr.png

Thanks to your suggestion, I got the background color working great. Now I’m trying to add a 1px line at the top of the listctrl, at the bottom of the listctrl, and at the bottom of the actual objects of the listctrl using colors I specify. Any thoughts on how to do that?

I’ve been studying the styles (or at least attempting to - anyone know of a site that just lists all possible styles?) but haven’t quite nailed something that can do exactly what I’m looking for yet.

Hi,

Doh - a simple answer, and works just fine. Thanks mate.
Let me try to raise the stakes a bit and give you a more difficult, related
question then.
So here is an image of what I'm looking for:
ImageShack - Best place for all of your image hosting and image sharing needs

Thanks to your suggestion, I got the background color working great. Now I'm
trying to add a 1px line at the top of the listctrl, at the bottom of the
listctrl, and at the bottom of the actual objects of the listctrl using
colors I specify. Any thoughts on how to do that?

Would suggest looking at the VListBox class for creating a control
like that. You can control all the drawing and appearance yourself to
customize it however you want.

I've been studying the styles (or at least attempting to - anyone know of a
site that just lists all possible styles?) but haven't quite nailed
something that can do exactly what I'm looking for yet.

Did you try the docs? (wxListCtrl)

Cody

···

On Thu, Mar 24, 2011 at 3:26 PM, seanybob <seanybob@gmail.com> wrote:

Would suggest looking at the VListBox class for creating a control
like that. You can control all the drawing and appearance yourself to
customize it however you want.

Excellent, thank you.

Did you try the docs? (wxListCtrl)

Doh. I've constrained all my searches to queries with "wxpython" in
them - I should have checked wxwidgets! Thanks mate.