zx icon indicating copy to clipboard operation
zx copied to clipboard

Decide which GUI technology we'd like to stick with

Open kosarev opened this issue 6 years ago • 5 comments

Part of #3.

General directions to consider:

  • No-GUI libraries: Cairo, PyGame, probably strengthened with SDL. It might be, our needs in terms of GUI are not very vast, in which case drawing icons manually (like we currently do on tape start/pause for example) may be considered acceptable or even desired.
  • "Classic" widget libraries: Qt, GTK/tkinter, wxWidgets, etc. Time-proven solutions, but not very appealing and may take a lot of time to implement desired GUI things.
  • Browser/JS-based solutions: Electron, NW.js, Flexx, etc. Relatively easy to use and allow great looking interfaces, though binding with Python and C++ and displaying pixel textures at acceptable FPS would be a pain.
  • A custom GUI on top of a low-level library like Skia. I wonder how much effort this approach would take.
  • A third-party GUI solution on top of other low-level libraries, such as ImGUI, Kivy, NanoVG, etc. Both seem like they do well with shaders/animations and generally look like a good fit for an emulator's interface.

kosarev avatar Oct 16 '19 14:10 kosarev

May I suggest IMGUI? I've used it for a chip8 emulator I wanted to run as cross platform on Linux, windows and mac. It works quite well and has many language bindings too.

ArjunNair avatar Oct 16 '19 15:10 ArjunNair

Thanks a lot, @ArjunNair! Added ImGUI to the list, and also found a similar project, Kivy. The first seems to be a popular choice for games, thus promising good performance, and the latter is itself written in Python. I'm going to see if there are more libraries of this kind, but I think at this point it's more or less clear that for this project any of these two would be a better choice comparing to solutions like Qt/wxWidgets/... and Electron/NW.js.

As to Skia, the library itself seems impressive, but the only GUI library built on top of it I found so far is https://github.com/skui-org/skui, and I would say the screenshots at http://www.thomthom.net/thoughts/2013/07/skui-a-gui-framework-for-sketchup/ look somewhat archaic. :-) So either there's a better alternative to Skui or we would need to write our own widgets, and I'm not sure how much time it would take given our needs...

kosarev avatar Oct 16 '19 21:10 kosarev

A good overview of the topic:

UIs in Python https://livingthing.danmackinlay.name/python_gui.html

Among other options, mentions this: https://github.com/vurtun/nuklear

kosarev avatar Oct 16 '19 22:10 kosarev

I use pygame directly (which is on top of SDL), not a gui itself. This list is pretty interesting!! :)

boriel avatar May 08 '20 20:05 boriel

@boriel Thanks, Jose. Added PyGame and Cairo to the list. It indeed might be that no-GUI is just enough for our needs. :-)

kosarev avatar May 09 '20 18:05 kosarev