JagStyle
JagStyle

Reputation: 31

GUI development for my c application . How to proceed?

I have developed an application in C which works on command line interface. I want to make my code display data over GUI, and I would also want to provide a window waiting for user input.

I need some directions on how to proceed. I came across a few sites saying libraries in python will serve the purpose.: WxPython, TKinter, PyQt

How to start abt? How do I link my C application to the GUI? And should I develop a GUI application, too, and then link it to my C application?

I am a beginner. Please help. Thanks.

Upvotes: 3

Views: 4426

Answers (3)

Toni Ruža
Toni Ruža

Reputation: 7512

Take a look at Cython for easily connecting the C world with the Python world if you decide to link your C code with the UI, it's highly convenient as a glue language.

Depending on your application, it might be a good option to keep it as a command line application that you call from a python program. The subprocess module is the usual route here, but there are some tools that can help even more -- like commandwrapper.

As for the GUI, apart from the already mentioned (perfectly viable) alternatives in other answers, Kivy is an interesting newcomer, and pyFLTK is a lightweight, easy-to-learn, old-school approach. These are a bit exotic, but it's good to know they exist.

Finally, QT5 was recently released and it shows a lot of promise. You might want to consider it if you don't mind writing C++, it's various language wrappers are not ready yet.

Upvotes: 2

Jason Satterfield
Jason Satterfield

Reputation: 147

You'll need to install the libraries for whichever GUI framework you want to use. WxWidgets is available for C, as well as Python, so you don't really need to link to the Python library. Other options (as indicated by Intelis) are GTK+ and QT.

If you're developing in Windows, then you may also use the Windows API to create your GUI application. Alternatively, you might consider using C++ (Either managed C++ or MFC).

Once you have installed the appropriate libraries, you will need to include them in your C source by using the #include <...> directive.

Take a look at these sites:

WxWidgets Tutorial.

GTK+ Tutorials

QT Tutorial

Upvotes: 0

intelis
intelis

Reputation: 8068

I recommend using GTK+ or Qt for your application.
They are popular, cross-platform and both have extensive documentation and great community.

Upvotes: 2

Related Questions