1

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
  • 1
    Appearance on the Daily WTF in 3...2...1... Sep 28, 2008 at 3:41

3 Answers 3

3

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

1
  • Thanks, found what I was looking for. It is hard to google for stuff when you don't know the name. Sep 28, 2008 at 4:24
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).

1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.