[wxpython-users] problems with customtreectrl ...
Andrea Gavana
andrea.gavana at gmail.com
Wed Apr 2 14:37:52 PDT 2008
Hi Stef and All,
On Wed, Apr 2, 2008 at 10:46 PM, Stef Mientki wrote:
> 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)
Have you tried the version in SVN (or the latest wxPython
pre-release)? You can find the SVN version here:
http://svn.wxwidgets.org/viewvc/wx/wxPython/trunk/wx/lib/customtreectrl.py?revision=51460&view=markup&sortby=date
Or download the latest wxPython pre-release here:
http://wxpython.wxcommunity.com/preview/20080310/
In these versions, TreeTextCtrl does not derive anymore from
wx.TextCtrl but from wx.lib.expandotextctrl, which does not have
scrollbars and does not look ugly (in my opinion).
> * dragging is ugly when full line width highlight is on
> (no solution)
I also don't have a solution, mostly because I don't have an idea on
how to improve it. If someone can propose a different way to implement
it, I am more than willing to actually code it.
>
> * making the treewindow wider, when full line width highlight is o, gives
> weird rendering
> ( no solution)
This is a rendering problem, I'll see if I can do something about it
by playing with the size/paint events.
>
> * 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
>
Again, I didn't try the latest CustomTreeCtrl version (SVN or
pre-release) it for this specific problem, but can you please try it
and see if it works? Otherwise I will play with it tomorrow at work.
> * 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
Sorry, I didn't even know this method existed... I'll add it and I'll
update the SVN code.
Thank you for the bug report!
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
More information about the wxpython-users
mailing list