Re: wx attributes for Tree control

Jussi Salmela <[email protected]>
Newsgroups gmane.comp.python.pythoncard
Message-ID <[email protected]>
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/


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.