tags:

views:

307

answers:

3

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.

+1  A: 

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

Ben Hoffstein
+3  A: 

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

John Millikin
Thanks, found what I was looking for. It is hard to google for stuff when you don't know the name.
Brian Paden
+2  A: 

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).

Eli Bendersky