+ 1

How do i make a more useful interface for my c++ code than just the console box ?

After completing the tutorial for coding using c++ , i find myself wondering how i would make a interface or output change from just the console box to something else i create or just more user friendly than text output . l am still just a beginner so if you could keep responses simple or just give general ideas for me to look into for the future that would be great.

30th Dec 2016, 9:25 AM
Adam Banham
Adam Banham - avatar
4 ответов
+ 4
What you need is a GUI. If you want to create a Window for drawing stuff onto, you would use the so-called WinAPI for that (on Windows anyway), but it's ugly and hard - you need around 100 lines of code just to get an empty window going that does nothing. So it's not really an option and you need to install some library that does all the hard stuff for you. The biggest, oldest and most well-known is Qt, it comes with a Qt designer where you can drag and drop stuff to make a nice interface. It is quite huge though and maybe a bit too complicated for your needs! Be sure to check it out though. I did a quick google and found the Nana library, which looks ok to be honest. http://nanapro.org/en-us/ Might be perfect for some quick and simple interfaces :) Either way GUI stuff is not very beginner-friendly in C++, even the Nana example uses lambdas, so you'll need a decent grip on the language.
30th Dec 2016, 9:53 AM
Schindlabua
Schindlabua - avatar
+ 3
Check out the Wx widgets, Qt or GTK library for GUI (graphical user interface) elements. Beware, it's a steep way up with a lot o variables depending on the systems you develop your program for. You could check java and it's script components or the easiest experience I had: Processing IDE (www.processing.org) with the G4P library and tool by Peter Lager Processing is based on Java but you write your program with asimplified version of the language and can export your sketches as executable program for windows, Linux and Mac. Nowing C++ you will not have problems. The G4P library and tool make GUI design a drag and drop job. the logic Event handlers is taken care by your code.
30th Dec 2016, 9:51 AM
seamiki
seamiki - avatar
+ 1
@Adam Please add "gui" tag to this question. Will be useful for others when searching
30th Dec 2016, 11:14 AM
Vishal++
Vishal++ - avatar
+ 1
@Vishal sure thing , just added it now for others
30th Dec 2016, 11:16 AM
Adam Banham
Adam Banham - avatar