I'm new GUI and programming as whole and so far I have a general understanding of c and have spent quite some time writing console applications.
I'm trying to learn GUI but have so far been unsuccessful. I've tried learning wxwidgets (through official documentation), gtk (through official documentation) and win32 (forgers win32 tutorial) but still haven't quite gotten there.
I still really want to but can't seem to find any good material. What would you recommend as start for a beginner?
It allows you to write native Windows applications that have access to the full set of GUI controls. You'll find a nice tutorial here on writing WinAPI applications in C. If you choose to go with Visual Studio, it also includes boilerplate code for a blank WinAPI application that will get you up and running quickly.
Many high quality GUI were written in C with, for example, Windows API. There's no particular reason why not, but object oriented programming was very successful in modeling interactive graphics. GUI elements somehow map naturally into C++ objects that can encapsulate complex behavior behind a simple interface.
graphical user interface (GUI), a computer program that enables a person to communicate with a computer through the use of symbols, visual metaphors, and pointing devices.
Many programming languages bolster GUI improvement as one of the centrepieces of its language highlights. C has no such library connected to it like the string library, IO library, etc, that we every now and again use.
If you are strictly limited to C, you have only a few choices. GTK+ is probably the easiest for a beginner.
An object oriented language like C++ is far more suited to GUI programming. If you like to use C++, I strongly recommend Qt, mainly because of its very good documentation, with very good tutorials especially for beginners.
I wouldn't suggest trying to do GUI with C. It's not really that comfortable to do so.
But if you really want to do it. Here's a quite nice tutorial on Windows API.
You can also use a library like Allegro, it is meant for games, but can be equally useful in programs.
But the way I would suggest is, first learn the basics of GUI and application (that means state machine) programming with a simple language (any simple will do, personally would suggest Lua with Löve2D platform). And then use the knowledge you got in C. The state machine and event-flow will be harder to grasp if you have to deal with garbage collection and pointers... (it's still possible to learn).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With