Background color of wxListBook

Is it possible to set the background colour of the listbook column containing
the icons?. I notice the demo is white, and tried setting the background
colour but that isn't it.

Thanks

richard

Richard Terry wrote:

Is it possible to set the background colour of the listbook column containing the icons?. I notice the demo is white, and tried setting the background colour but that isn't it.

It's just an embedded wx.ListCtrl, so you can find a reference to is and then treat it like any other list control. Something like this will probably do it:

  listbook.GetChildren()[0].SetBackgroundColour("light blue")

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Worked a treat.

Is is also possible to have control over the embedded listctrl column size?

Regards

Richard

···

On Tue, 7 Sep 2004 03:18 am, Robin Dunn wrote:

Richard Terry wrote:
> Is it possible to set the background colour of the listbook column
> containing the icons?. I notice the demo is white, and tried setting the
> background colour but that isn't it.

It's just an embedded wx.ListCtrl, so you can find a reference to is and
then treat it like any other list control. Something like this will
probably do it:

  listbook.GetChildren()[0].SetBackgroundColour("light blue")

Ew. Yuk. That looks *incredibly* brittle. I can easily envision a
change in which GetChildren()[0] would NOT return a reference to the
wx.ListCtrl, but something else that was part of the 'collective'.

In some classes, I've seen that we have access to a public reference
to components of such classes (e.g. 'self.listctrl') or the underlying
methods are implemented at the top level (e.g. 'SetBackgroundColour =
self.listctrl.SetBackgroundColor).

Food for thought.

···

On Mon, 06 Sep 2004 10:18:54 -0700, Robin Dunn <robin@alldunn.com> wrote:

It's just an embedded wx.ListCtrl, so you can find a reference to is and
then treat it like any other list control. Something like this will
probably do it:

        listbook.GetChildren()[0].SetBackgroundColour("light blue")

--
Best,

    Jeff

Richard Terry wrote:

Worked a treat.

Is is also possible to have control over the embedded listctrl column size?

No, that is handled in the Listbook's EVT_SIZE handler.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Jeff Grimmett wrote:

···

On Mon, 06 Sep 2004 10:18:54 -0700, Robin Dunn <robin@alldunn.com> wrote:

It's just an embedded wx.ListCtrl, so you can find a reference to is and
then treat it like any other list control. Something like this will
probably do it:

       listbook.GetChildren()[0].SetBackgroundColour("light blue")

Ew. Yuk. That looks *incredibly* brittle. I can easily envision a
change in which GetChildren()[0] would NOT return a reference to the
wx.ListCtrl, but something else that was part of the 'collective'.

Yep. I have it on my ToDo to add a GetListCtrl accessor.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!