Something like Explorer's icon grid view in a Python GUI

I am making a Python gui project that needs to duplicate the look of a Windows gui environment (ie Explorer). I have my own custom icons to draw but they should be selectable by the same methods as usual; click, ctrl-click, drag box etc. Are any of the gui toolkits going to help with this or will I have to implement it all myself. If there aren't any tools to help with this advice would be greatly appreciated.

edit I am not trying to recreate explorer, that would be madness. I simply want to be able to take icons and lay them out in a scrollable window. Any number of them may be selected at once. It would be great if there was something that could select/deselect them in the same (appearing at least) way that Windows does. Then all I would need is a list of all the selected icons.


Asked by: Stuart973 | Posted: 27-01-2022






Answer 1

Python has extensions for accessing the Win32 API, but good luck trying to re-write explorer in that by yourself. Your best bet is to use a toolkit like Qt, but you'll still have to write the vast majority of the application from scratch.

Is there any way you can re-use explorer itself in your project?


Updated for edited question:

GTK+ has an icon grid widget that you could use. See a reference for PyGTK+: gtk.IconView

Answered by: John959 | Posted: 28-02-2022



Answer 2

In wxPython there's a plethora of ready-made list and tree controls (CustomTreeCtrl, TreeListCtrl, and others), a mixture of which you can use to create a simple explorer in minutes. The wxPython demo even has a few relevant examples (see the demo of MVCTree).

Answered by: Melissa397 | Posted: 28-02-2022



Answer 3

I'll assume you're serious and suggest that you check out the many wonderful GUI libraries available for Python.

Answered by: Roland138 | Posted: 28-02-2022



Similar questions

python - Show Explorer's properties dialog for a file in Windows

Is there an easy way to show the properties dialog for a file in Windows using Python? I'm trying to show the same window that pops up when you right click a file in Explorer and choose Properties.






Still can't find your answer? Check out these communities...



PySlackers | Full Stack Python | NHS Python | Pythonist Cafe | Hacker Earth | Discord Python



top