hello (Andrea),
Although CT has some very nice features,
I think it still a bit buggy (or I don't use it correct
(I might have mentioned a few of these items in this list)
Solutions I found are created by trial and error, because this code is far beyond my knowledge)
* editor is multiline editor, which is quit ugly in single line applications
(remove wx.TE_MULTILINE in TreeTextCtrl at line 950)
* dragging is ugly when full line width highlight is on
(no solution)
* making the treewindow wider, when full line width highlight is o, gives weird rendering
( no solution)
* when focus is lost in edit mode, editor doesn't disappear.
This is a very serious bug, because also moving to another item in the tree while editing,
can give very weird effects (and even hang the program)
solution:
聽聽聽聽def OnKillFocus(self, event):
聽聽聽聽聽聽聽聽self._aboutToFinish = True
聽聽聽聽聽聽聽聽self.AcceptChanges()
聽聽聽聽聽聽聽聽wx.CallAfter(self.Finish)
聽聽聽聽聽聽聽聽event.Skip()
Now this gives an error, so we also change
聽聽聽聽def Finish(self):
聽聽聽聽聽聽try:
聽聽聽聽聽聽聽聽if not self._finished:
聽聽聽聽聽聽聽聽聽聽聽聽self._finished = True
聽聽聽聽聽聽聽聽聽聽聽聽self._owner.SetFocusIgnoringChildren()
聽聽聽聽聽聽聽聽聽聽聽聽self._owner.ResetTextControl()
聽聽聽聽聽聽except:
聽聽聽聽聽聽聽聽pass
* Del-Key bound as an accelerator key prevents the use of del-key in editor.
solution, catch the onkeydown with a normal Bind :
聽聽聽聽self.Bind ( wx.EVT_KEY_DOWN, self.OnMyKeyDown)
聽聽def OnMyKeyDown ( self, event ) :
聽聽聽聽if not ( self.GetEditControl () ) :
聽聽聽聽聽聽if event.GetKeyCode() == wx.WXK_DELETE :
聽聽聽聽聽聽聽聽self.Delete_Item ( self.GetSelection () )
聽聽聽聽聽聽else :
聽聽聽聽聽聽聽聽event.Skip()
聽聽聽聽else :
聽聽聽聽聽聽event.Skip()
* InsertItemBefore is not implemented,
solution, can be done through PrependItem
cheers,
Stef