Best way to "get into" creating "GUI" programms?

Time appropriate greetings everybody!

I have just recently (few weeks ago) gotten into messing around with writing C++ "console applications".
For some of the little projects that I am working on, having an actual GUI would be a nice thing to have.
(To do things like display graphs, enter values, have things like "save txt file as"-dialogues, nothing too fancy ...)

What is the "best way" for a beginner like me to "get into" creating GUI applications (in C++)?

Does anybody have any good (preferably written) tutorial that they can recommend?
What "tools" do I need?

The "IDE" that I am using is CodeLite on a Win10 computer.
(No, I do NOT want to use visual studio, because you have to register to use that)
Sounds like what you want is what's known as a "widget toolkit", amongst other things.

It's a set of classes and functions that make it easier for you to do what you said; create windows, dialog boxes, little pictures with buttons, the usual "Save As" type menus and so on.

Here's a huge list:
https://en.wikipedia.org/wiki/List_of_widget_toolkits

Very popular right now is Qt. Which does NOT require you to buy, does NOT require you to use QT's own IDE. As you can see, there are many others.

The general principle is that your OS can do it all for you, and your could use your OS API directly, but that's a real pain, so you use the toolkit, and the toolkit talks to your OS for you.
Thanks for that quick answer ...
I will have a look at that list.

I think the most difficult thing to "get into" will be that there is not just "one file" with a nice little "main" function that you put your code into.

Or is there ...?

From what I have heard / read, this GUI stuff works more with "events", so like "IF you click this button, DO this ...".
So not the typical "sequential" approach that a classic console application has ...
Well ...
I have been reading a bit into working with this GUI stuff and the only thing I got out of it was a headache ...

I think I will keep to using the console as a UI until I have "mastered" the basics of objects and things like that. (Because unitl now, I have used "objects" just like "better" arrays).


(Or I will just use a microcontroller that controls a graphical LCD display and my "PC-programm" will interface with that via RS232 to display things like graphs, because I am pretty sure I can do that.
That way I can combine my knowledge of that kind of things with the "processing power" and "huge memory" of an actual PC)
If you don't mind your GUIs looking kind of aged by default, you could try learning FLTK. It might be a gentler introduction to GUI programming than Qt is.

https://www.fltk.org/doc-1.3/index.html

Also, you're quite right: most GUI programming is quite event driven. And if you wanted, you certainly could stuff all of your application's code into main, but… I wouldn't recommend it once your main file starts getting hundreds of lines long. :P

-Albatross
Hmmm ...
That seems interesting...
No, I don't mind an "old looking GUI", I am not one of those people who wants nice curved edges and shaded colours and nonsense like that.

About "putting everything in 'main' ":
Well, for the project I am currently working on, if I were to put everything into main it would be a lot more then a few hundret lines ....
(I know that lots of that is "commented out" documentation stuff and things like COUTs, but anyway ...)
Ftrom what I have heard / read, this GUI stuff works more with "events", so like "IF you click this button, DO this ...".

https://doc.qt.io/qt-5/signalsandslots.html
BTW main in a Qt project is invariably about a dozen lines, if that.
https://doc-snapshots.qt.io/qt5-5.12/qtquick-window-main-cpp.html
Registered users can post here. Sign in or register to post.