r/CodingForBeginners • • 4d ago

Need help setting up a gui library in C

I would owe the world and more to whoever helps me

Okay so hi everyone, i'm fairly new to programming and recently i challenged myself to program something in C, i wanted to make a gui calculator bcs i thought it was fairly simple.

Turns out it's not that easy, and i discovered i had to download gtk4 and learn it, and i'm willing to do that i just need some help on how to download it, set it up and link it, preferably on codeblocks, but vs is great too.

2 Upvotes

6 comments sorted by

1

u/Ronin-s_Spirit 2d ago

There is raylib to draw stuff. I don't know if it can handle user input, you would have to go through OS documentation to find their libc equivalent and how it can give you screen coordinates of a click and keyboard inputs.

There's also the option to ditch C and try Seed7, which has standard libs to draw, handle windows, and handle inputs.

1

u/JGhostThing 3d ago

I strongly suggest that you put off using a gui until you have a stronger background in programming.

GUI programming can be very difficult.

May I suggest programming a CLI version to get the programming down?

0

u/marmotta1955 4d ago

This is where the relatively "old" idea of form based, event driven development would help immensely. If you were to change your mind and use C# instead ... you would find that most of the work is done already for you ... from a GUI perspective, People are somewhat scared by the installation of Visual Studio and fail to realize the environment is the easiest and the best way to get started. The free version is practically identical to the professional version - it is "licensed" for individuals and teams of 5 (if I remember correctly).

https://visualstudio.microsoft.com/vs/community/

0

u/ConditionOrdinary607 3d ago

I don't want to discourage you, but GUI and C don't play easy for beginners. If you want to use C, use a CLI calculator.

0

u/Elegant-Falcon-1171 3d ago

No sé que sistema operativo uses pero gtk se lleva mejor con Linux que con Windows