N
N
nadom2014-09-19 19:37:37
C++ / C#
nadom, 2014-09-19 19:37:37

How to create a GUI in pure C?

Hello.
I mastered the C language to the extent that my IT university offers, I think that I understand it quite well.
In this regard, there is a desire to modernize some of their programs by adding a GUI to them.
There is very little advice on this on the Internet, which is why I wrote here:
maybe someone wrote C programs with a high-quality graphical interface and how is it done?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
K
KOLANICH, 2014-09-19
@nadom

There is also visual c++ (based on dotnet, you can use Windows Forms or Windows Presentation Foundation), which fits perfectly with regular c++ through #pragma managed and #pragma unmanaged

S
Sergey, 2014-09-19
Protko @Fesor

Take Qt, learn C++ and write only libraries here.
ps sish programs should be only under the console, because it's true.

M
Melkij, 2014-09-19
@melkij

Light up the API of the graphical shell under which you are writing, and create a gui.
As far as I remember my experiments ten years ago - just creating an empty window on WinAPI - about 200 lines of code.

P
Push Pull, 2014-09-19
@deadbyelpy

I wonder what it means with "quality", I believe that the "goodness" of the interface is its convenience, and if you are talking about convenient development, so hmm, well, as you have to.
there are iUP , GTK+ , and others, do you need cross-platform?, and you want to draw system controls - are there any docks for this, or your own? - dig Qt for example, your controls are drawn there.

R
raiton777, 2018-10-17
@raiton777

It is important to decide on which platform.
If Windows, then you can use Visual Studio and Windows Forms.
True, you will need to know WinAPI well, since VS is designed to work with C ++.
And many things will have to be done by hand. A window with buttons in VS is created without problems, but with connecting events to them, you suffer. Since the C language can only imitate OOP, but how to do this is a separate complicated topic.
You can use Qt Creator. It also presents opportunities to create a gui. But this ide is also tailored for C++ and OOP paradigm. Although it is possible to write in it in C and with gui, but with crutches.
Now, to create a gui in pure C, they use the Glade gtk visual interface designer. He himself is entirely written in C. It uses the GTK+ widget library, which is also written in pure C.
The project is maintained by the GNOME Foundation.
The description of the interface visually created by the developer is stored in XML files, which can then be connected to programs at runtime using the GtkBuilder object.
To work with C, I use the Code Blocks IDE, I have it installed in both Windows and Linux.
When creating a project, the GTK+ library and an xml file with a description of the widgets created in Glade are connected to it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question