0

I am currently writting a c++ console app with libraries such as iostream, algorithm and cstring, but in the future I would like to add an UI to it, mostly buttons and input fields. I am looking for a (commercially) free library that will allow me to simply add an interface on top of what I have already written, a one where communicating and passing data is easy, and one where I don't have to rewrite most of my program's logic using the GUI's functions for the interface to work. Thank you.

skot
  • 3
  • 1
  • There is no silver bullet; your application will have to be written to accommodate swapping out the user interface. If you put `std::cin >> x` in your program **no GUI library** can provide a drop-in replacement. – Botje Sep 01 '20 at 13:28
  • 1
    Split the project into 2 layers (logical modules) processing and input/output and don't mix the two. Then you can just replace the input/output layer with GUI code and call the unchanged processing code. – Richard Critten Sep 01 '20 at 13:30
  • 1
    @botje well, technically someone could write a replacement cin/cout that creates a window, display stuff and allow user-input. It would be a crappy UI and not offer much more than the console, but "no GUI library can provide a drop-in" may be an over statement. – Jeffrey Sep 01 '20 at 13:49
  • Thank you guys, it's just that I have been looking for a good easy library for so long, I lost all motivation, when I started coding it in the console, I was so happy that I actually made progress, as I knew what I was doing. I just find it rather annoying that I have to change so much just to create a couple of buttons – skot Sep 01 '20 at 14:57
  • Here I describe an app which I developed first in the console, then I added a simple UI (with wxwidgets): https://compphys.go.ro/dft-for-an-atom/ stdout is simply redirected into an edit box (actually a rich text control if I recall correctly). – Adrian Roman Sep 01 '20 at 15:06

1 Answers1

0

I recommend wxWidgets, it's easy to use. It uses the platform's native API and also free.

  • Hello and welcome! This is actually a nice answer, but lacks a bit of research into the reqirements of the OP. These kind of questions are better to be redirected to https://softwarerecs.stackexchange.com/ – g_bor Sep 01 '20 at 13:58