hello,
We had already the discussion of the weird behaviour of the tree in the wxPython demos,
now I was hoping CustomTreeCtrl didn't have this behaviour
but it has
I've an application, where there's only one item that can receive focus,
and that's an CustumTreeCtrl.
The other part is a drawing canvas, which can't receive focus,
but needs to catch key events, when the user is working on the drawing canvas.
So I created a dummy panel which is placed behind the CustomTreeCtrl.
This dummy panel receives focus when the user works on the drawing canvas,
enabling key reception to the drawing canvas.
聽聽聽self.Splitter = wx.SplitterWindow ( self, 11, style = wx.SP_LIVE_UPDATE)
聽聽聽聽# **********************************
聽聽聽聽# dummy panel, to fetch key-events for the drawing canvas
聽聽聽聽# MUST NOT INTERFERE WITH THE TREE CONTROL !!!
聽聽聽聽self.Panel_Left_Bottom2 = \
聽聽聽聽聽聽wx.Window ( self.Splitter, pos = ( 1, 1500 ), size = ( 1,1 ) )
聽聽聽聽# **********************************
聽聽聽聽self.Tree = MyCustomTreeCtrl (self.Splitter, self,'TREE ROOT')
聽聽聽聽self.Shape_Container = tPyLabView_ShapeCanvas (
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽self.Splitter, self, pos=(0,0),size=(500,500))
As you can see, I now have placed the dummy panel off screen.
But at the start I put the dummy panel, just in the upper left corner,
and it has a size of (50,50)
In this case it's impossible to expand the first node in the tree,
by clicking on the +/- sign of the tree.
Apparently, the click is not received by the tree,
but is received by the dummy panel.
I used this trick many times in other languages, without any problems.
So I wonder if this "ghost" behavior is general for wxPython ?
thanks,
Stef Mientki