DirListCtrl is a wxPython ListCtrl-like widget optimized for directory lists.
It handles sorting when its column header is clicked on, it is a drop target which accepts files dragged from a file manager and can also have its contents programmatically added or removed.
Click here to download the code containing the DirListCtrl class.Tested on wxPython 4.1.0 (gtk3) on Python 3.7.3 on Raspberry Pi OS and on wxPython 4.1.1 (gtk3) on Python 3.8.10 on Mint (Mate). DirListCtrl is distributed under the BSD-3-Clause License.
label and header are the strings
shown in the control; tool_size and bmp_size refer to the size
of the control's Add and Remove buttons and their bitmaps; style
is one of wx.Window's
available border styles.
Adds a python list of directories to the control.
Returns the directories shown in the control as a python list.
Removes all directories from the control.