Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how can i hide the button on wx.GenericDirCtrl tree? #2550

Open
dw-choi-1105 opened this issue May 3, 2024 · 0 comments
Open

how can i hide the button on wx.GenericDirCtrl tree? #2550

dw-choi-1105 opened this issue May 3, 2024 · 0 comments

Comments

@dw-choi-1105
Copy link

dw-choi-1105 commented May 3, 2024

Operating system: windows 10
wxPython version & source: wxpython 4.2.1
Python version & source: Python 3.11.8

Description of the problem:
i found the bug in the button on tree control of wx.GenericDirCtrl. (exactly +/- button)

That is bug scenario in wx.GenericDirctrl

  1. multi-selected some folders, and then collapsed the node by clicking - button
  2. expand the node by clicking + button
  3. re multi-selected some folders as i selected in step 1
  4. click the parent node of nodes that i selected in step 3

then bug will be occured, and python crash, app crash occured.
i found that these phenomenon is only occured when i cliecked the +/- button to expand or collapse the nodes
(that is also occured in GenericDirCtrl demo code of wxpython 4.2.1)

so that reason, i want to hide the button of wx.GenericDirCtrl tree for avoiding this phenomenon
is there any method to deal with this problem?
that is the my code to hide GenericDirCtrl button, but it was not working

Code Example (click to expand)
# Put code sample here
class TestPanel(wx.Panel):
    def __init__(self, parent, log):
        wx.Panel.__init__(self, parent, -1)

        self.log = log

        txt1 = wx.StaticText(self, -1, "style=0")
        dir1 = wx.GenericDirCtrl(self, -1, size=(200,225), style=0)

        txt2 = wx.StaticText(self, -1, "wx.DIRCTRL_DIR_ONLY")
        dir2 = wx.GenericDirCtrl(self, -1, size=(200,225), style=wx.DIRCTRL_DIR_ONLY)

        txt3 = wx.StaticText(self, -1, "wx.DIRCTRL_SHOW_FILTERS\nwx.DIRCTRL_3D_INTERNAL\nwx.DIRCTRL_MULTIPLE")
        self.dir3 = wx.GenericDirCtrl(self, -1, size=(200,225),
                                 style=(wx.DIRCTRL_SHOW_FILTERS |
                                       wx.DIRCTRL_3D_INTERNAL  |
                                    wx.DIRCTRL_MULTIPLE
                                       ) & ~wx.DIRCTRL_SHOW_FILTERS,
                                 filter="All files (*.*)|*.*|Python files (*.py)|*.py")

        # test
        self.dir3.TreeCtrl.SetWindowStyle(wx.DIRCTRL_3D_INTERNAL & ~wx.TR_HAS_BUTTONS)
@dw-choi-1105 dw-choi-1105 changed the title how can i hide the button on how can i hide the button on wx.GenericDirCtrl tree? May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant