|
From: Jussi S. <jus...@pp...> - 2007-03-26 20:18:44
|
hwg kirjoitti:
> Thanks for the help. This worked for the TR_MULTIPLE attribute.
> Curiously, when I tried to set TR_HIDE_ROOT, Python crashed!
>
> hg
>
> *//*
I don't even know how the wx.TR_HIDE_ROOT is supposed to make the tree
to behave.
It 'works' for me and doesn't crash. Are you using new enough versions
of Python, wxPython and PythonCard? My environment is:
PythonCard version: 0.8.2
wxPython version: 2.6.1.0
Python version: 2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32
bit (Intel)]
Platform: win32
The only thing I can make wx.TR_HIDE_ROOT to do is hide the whole tree
and I can never get it back to visible again. I do this on initialize:
tree.SetWindowStyleFlag(wx.TR_MULTIPLE) # <== added by JS
self.initialFlags = tree.GetWindowStyleFlag()
tree.SetWindowStyleFlag(self.initialFlags | wx.TR_HIDE_ROOT) #
<== added by JS
print self.initialFlags
and it hides the tree alright but then I have a button with code that is
supposed to do the opposite i.e. make the tree visible again but doesn't:
tree = self.components.tree
print tree.GetWindowStyleFlag()
if tree.GetWindowStyleFlag() & wx.TR_HIDE_ROOT:
tree.SetWindowStyleFlag(self.initialFlags)
else:
tree.SetWindowStyleFlag(self.initialFlags | wx.TR_HIDE_ROOT)
print tree.GetWindowStyleFlag()
tree.redraw()
I tried tree.Refresh() also with no avail. But on the bright side is
that it doesn't crash ;)
Sorry I can't be of more help
Cheers,
Jussi
--
Jussi Salmela
http://personal.inet.fi/cool/operator/
|