<p>I am using a wxGenericDirCtrl, and I would like to know if there is a way to hide directories, I'd especially like to hide siblings of parent nodes.</p>

<p>For example if my directory structure looks like this:</p>

<pre><code>+-a
  |
  +-b
  | |
  | +-whatever
  |
  +-c
  | |
  | +-d
  |   |
  |   +-e
  |   |
  |   +-f
  |   
  +-g
    |
    +-whatever
</code></pre>

<p>If my currently selected directory is /a/c/d is there any way to hide b and g, so that the tree looks like this in my ctrl:</p>

<pre><code>+-a
  |
  +-c
    |
    +-[d]
      |
      +-e
      |
      +-f
</code></pre>

<p>I'm currently working with a directory structure that has lots and lots directories that are irrelevant to most users, so it would be nice to be able to clean it up.</p>

<p><strong>Edit</strong>:
If it makes a difference, I am using wxPython, and so far, I have only tested my code on linux using the GTK backend, but I do plan to make it multi-platform and using it on Windows and Mac using the native backends.</p>

[{'answer_id': 60745, 'author': 'Gareth Simpson', 'author_id': 147, 'author_profile': 'https://Stackoverflow.com/users/147', 'pm_score': 0, 'selected': False, 'text': "<p>I don't think that's possible.</p>\n\n<p>It would be relatively easy to add this functionality to the underlying C++ wxWidgets control, but since you're using wxPython, you'd then have to rebuild that as well which is a tremendous issue.</p>\n"}, {'answer_id': 64273, 'author': 'Eli Bendersky', 'author_id': 8206, 'author_profile': 'https://Stackoverflow.com/users/8206', 'pm_score': 2, 'selected': True, 'text': '<p>Listing/walking directories in Python is very easy, so I would recommend trying to "roll your own" using one of the simple tree controls (such as TreeCtrl or CustomTreeCtrl). It should really be quite easy to call the directory listing code when some directory is expanded and return the result.</p>\n'}]
['https://Stackoverflow.com/questions/52844', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3051/']