Re: Class hierarchy for thumbnailctrl
Michael Eager <[email protected]>
| Newsgroups | gmane.comp.python.wxpython |
|---|---|
| Message-ID | <[email protected]> |
On 9/5/20 10:31 PM, Andrea Gavana wrote: > Hi, > > On Sat, 5 Sep 2020 at 23.24, Michael Eager <[email protected] > <mailto:[email protected]>> wrote: > > Can anyone explain why this is being done? It would seem cleaner (and > definitely more understandable) to have ThumbnailCtrl inherit from > ScrolledThumbnail and Panel. > > It’s been a long time since I’ve looked at the ThumbnailCtrl code, but I > don’t think there is any issue in changing the implementation so that > ThumbnailCtrl inherits from wx.Panel and ScrolledThumbnail. I agree it > would be much neater that way... > > If you can put together a pull request and see if things work correctly > I’m pretty sure Robin will consider it for merging. > > Andrea. Hi Andrea -- I've been looking at thumbnailctrl.py in more detail. There are some problems with the control. Setting the Zoom factor doesn't do anything; the _zoomfactor value is never used. Zooming with the + or - key doesn't appear to have any affect. I have the impression that thumbnailctrl.py is an app trying to masquerade as a control. It does more than just display thumbnails in a window: it reads a directory, sorts the files by name, displays a combobox with the path, deletes files, maybe more. This makes it much less flexible as a control, for example, if I want to display thumbnails in a different order, or supply images to be displayed, rather a directory. Some of these features, like displaying a combobox with the path, could easily be done in an app which used a simpler thumbnail display control. There are comments about the control not knowing how to display certain file types, like mpegs. I would also like to be able to display thumbnails for files like PDFs or text files. It seems to me that rather than include in the control the knowledge of how to do this for many different files, that images should be provided by the caller, perhaps through a callback routine, with a default for the common image types. There a lot of good code in the control, especially the layout and resizing. I was trying to figure out how to do the layout using grid sizers, which seemed convoluted. What would you suggest? -- Michael Eager -- You received this message because you are subscribed to the Google Groups "wxPython-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/2f1b3dca-3333-6411-cedc-1535b8711402%40eagercon.com.