VirtualTree mixin vs. TR_HIDE_ROOT style

I'm using a CustomTreeCtrl with the VirtualTree mixin, in wxPython
2.9.1.1. Using the TR_HIDE_ROOT style doesn't appear to work when
combined with VirtualTree. The mixin docs even say the TR_HIDE_ROOT
style is forced when using VirtualTree, but it remains visible. Even
the 2.9.1.1 Docs & Demos app has it visible in the TreeMixin demo.

Is this a bug or is there a secret to hiding the root I'm missing?
Thanks.

- Adam

Sounds like a bug. I'm sure that Andrea and/or Frank would appreciate any help you can give in tracking down the cause.

···

On 1/27/11 4:21 AM, Adam Pletcher wrote:

I'm using a CustomTreeCtrl with the VirtualTree mixin, in wxPython
2.9.1.1. Using the TR_HIDE_ROOT style doesn't appear to work when
combined with VirtualTree. The mixin docs even say the TR_HIDE_ROOT
style is forced when using VirtualTree, but it remains visible. Even
the 2.9.1.1 Docs& Demos app has it visible in the TreeMixin demo.

Is this a bug or is there a secret to hiding the root I'm missing?

--
Robin Dunn
Software Craftsman

It's caused by a renaming of style parameters in AGW that's backwards
incompatible. To hide the root of a CustomTreeCtrl the __init__ of
VirtualTree should pass a agwStyle=wx.TR_HIDE_ROOT instead of a
style=wx.TR_HIDE_ROOT.

Since the VirtualTree .__init__ method passes on any keyword
arguments, you should be able to fix this issue yourself by passing
the agwStyle=wx.TR_HIDE_ROOT, like this:

class MyCustomVirtualTree(wx.lib.mixin.VirtualTree, wx.lib.agw.CustomTreeCtrl):
   def __init__(self, *args, **kwargs):
      super(MyCustomVirtualTree,
self).__init__(agwStyle=wx.TR_HIDE_ROOT, *args, **kwargs)
      ...

Cheers, Frank

···

2011/1/28 Robin Dunn <robin@alldunn.com>:

On 1/27/11 4:21 AM, Adam Pletcher wrote:

I'm using a CustomTreeCtrl with the VirtualTree mixin, in wxPython
2.9.1.1. Using the TR_HIDE_ROOT style doesn't appear to work when
combined with VirtualTree. The mixin docs even say the TR_HIDE_ROOT
style is forced when using VirtualTree, but it remains visible. Even
the 2.9.1.1 Docs& Demos app has it visible in the TreeMixin demo.

Is this a bug or is there a secret to hiding the root I'm missing?

Sounds like a bug. I'm sure that Andrea and/or Frank would appreciate any
help you can give in tracking down the cause.