C and GUI Programming don’t get along well.
In this video, I used a lesser-known framework for Graphical User Interface (GUI) programming called GTK (as opposed to Java’s JavaFX, Python’s Tkinter, or C++’s Qt) to design a GUI for a very basic arithmetic calculator. No parsing, no decimals, no advanced functionality — just a day to learn GUI development in pure C.
To be clear, there are actually MANY ways to do GUI design even in just C. I considered using OpenGL or SDL, though those options seemed more tailored for game development, or even the native Windows API. I ultimately chose GTK because of it was a bit simpler than the Windows API and for it’s cross-platform compatibility (across Windows, Linux, and Mac).
It was really cool seeing how GTK incorporated an Object-Oriented Programming (OOP) framework into pure C. Of course, GTK is also available in other OOP languages, but it was cool seeing how you technically don’t need ‘classes’ this way.
source

Maybe one day I'll build Photoshop from scratch.
Скажи коммьюнити linux что gtk малоизвестен и тебя тут же отправят обратно в палату 😂
Regarding "This is why you don't build GUIs in C"
We could stop pretending that using OOP, or something who resembles OOP, is a clever idea for making GUI programs.
One could instead use a graph of data called a scene graph
"A scene graph is a hierarchical data structure, which cascades the inheritance or spatial representation of a set of objects.
The simplest form of a scene graph uses an array or linked list data structure, and displaying its shapes is simply a matter of linearly iterating the nodes one by one. Other common operations, such as checking to see which shape intersects the mouse pointer are also done via linear searches. For small scene graphs, this tends to suffice. " : https://en.wikipedia.org/wiki/Scene_graph
There're standardized file formats for storing scene graphs.
If one is smart, one uses handles so stuff can be moved freely, e.g. through a network (client/server architecture), another location in memory, or a file, if one want to implement a Smalltalk like image – or – just want to use less physical RAM.
bro uses unconfigured vim
Wher can I start learning c and then c++
OOP make everything complicated, it's easy to build simple things.
but theveasy stuff why we need this complicated framework like gtk/javafx/… to build simple things.
i am not dev, but i like to use raylib or sdl to build ui.
Also GTK has Python support
I just started getting into programming. I wonder if making a GUI for a calculator in C# would be a lot easier.
just use holy C
Boy you should try to use Xm (Motif) or Xaw and you will be glad about gtk…
C++ has cutie and C has satan😂
C++ doesn't have qt as it's not really an open source.
its just a skill issue
I love v programming. Simple syntax but has an excellent standard library.
GUI is inherently object oriented
This isn’t Yandere simulator 😂 I caught that reference
Bro is using oop from first principles
5:04 In a programming course at my university when we were programming in the computer labs we'd have to show off our work at the end. Now most teachers would ask basic questions and have you show the main functionality of the program but there was this one guy who asked for the edgiest of edge cases every time. When we did calculators the first thing he asked me was to divide 0 by 0 and then to take a root of -1.7. When we were doing a car park database he asked me to delete a car from my database and THEN unpark it. Anyway, this reminded me of him. Good times.
well… i'm fine with ncurses 😊
Embarcadero C++ Builder. Несколько минут – и готово.
JUST USE CIMGUI
Nuclear liked this video.
drawing buttons isn't interesting. Managing state, composing elements, propagating behaviour are.
I built my own GUI in C without GTK, just on SDL.
if you need UI for simple stuff, stuck to most common use libraries in simpler languages such as JavaFx with Kotlin or Python Tkinter.
I didn't watch your whole video, I saw you tried to use an XML file to load your GUI but you didn't mention Glade.
I'm not a fan of Gnome Tool Kit, but you can create your UI XML with Glade. It generates your GUI with an XML file or an object binary file with header.
What you are doing in this video is equivalent to generate Android Layout GUI Widgets programmatically. Which is not wrong depending on the implementation of your GUI.
That same interface created with Glade XML file works with Python GTK as well.
There is this book called "Object-oriented Programming with ANSI-C". You should check it out in your interested in the OOP paradigm in C.
do u not use Visual studio code? im a new subcriber btw.
Windows NT, 2000, Server 2003 were written almost exclusively in C, so there were a few GUIs in there
"we don't need classes or objects" while the gtk slop is sitting right there
Just do it like normal people and write the backend (API) in C and the frontend in whatever you desire. Godot or Python i guess.
I don't really understand the confusion around object oriented programming and C; OOP is a pattern, and that pattern can be applied when writing C code. Some languages make OOP a part of the design of the language (like C++/Java/etc.) – C does not, but it also doesn't stop you doing OOP, you just have to implement the constructs yourself e.g. VTables.