I'd like a Python-accessible function show_image(...)
that launches a fairly simple image viewer, where the image is specified as (for example) a NumPy array. Importantly, I'd like for this function not to block, but for the script to continue execution while maintaining interactivity of the window.
I realize that the giant design flaw and all around pain-in-the-ass known as the Global Interpreter Lock will thwart any Python-based GUI running in parallel with Python code in the main thread, so I'd obviously need to launch a thread that releases the GIL and does everything in C/C++.
I'm comfortable wrapping such a thing with Cython (or in a handwritten C extension module) but I'm looking for the right GUI solution. It should be cross-platform and easy to build in conjunction with a Cython extension (the latter of which seemingly rules out Qt/qmake/etc.)
Importantly, I'd like to be able to launch multiple windows this way, on demand. It seems that most GUI toolkits have some run()
-like function that needs to be called at the end of the main thread program's main()
, making it not terribly clear to me how I'd go about launching a window more than once. I guess I could launch a separate GUI event loop every time, but that seems like a recipe for disaster (as I recall, it is explicitly unsupported by GTK+, at least).
I'll also say that fork()
'ing is not an option.