Thumbnails into a window panel?

#1

Hi all. I have a folder of thumbnails, and I wanted to load those thumbnails into a window panel in Maya with python, so that I can see those thumbnails, and potentially load the file associated with the thumbnails into my current scene (kind of like an asset browser, basically)

What’s the typical way of going about this?

The best I could do was a textScrollList, that pops up a window with the thumbnail (but only that one) using the cmds.picture() command, when the item is selected, then import if double clicked. Problem is the previous windows don’t close themselves so I get left with too many windows.

But the ideal solution is to lay it out neatly into one panel and to import the associated file if I click on the thumbnail or something.

Would appreciate any help! I’m pretty inexperienced with scripting.