-2

How to develop a GUI for my program.I have made a c program to encrypt and decrypt any secret text message. I am hiding the message in the spaces between the words.

2 Answers2

1

There are some GUI frameworks for C.

  • GTK is one of the most used when porting Linux applications
  • IUP is very lightweight
  • other listed on Google

However, my preferred solution to to add a rich GUI to C programs in a quick way, is to use Tcl/Tk. You can separate completely your application from the interface, test the C code at your leisure using the command line and concentrate on the GUI as a separate effort.

There are two possible approaches for mixing Tcl/Tk and C:

  • Create an executable and call it from the Tcl/Tk GUI with [exec ... ]
  • Create a DLL and call the functions as tcl commands

The first approach is extremely easy but might be unsatisfactory from an esthetic point of view.

The second approach is a little bit more complex and has two variants: create a real tcl module or use [ffidl][4] to call the dll directly. This time, the second is simpler than the former.

Finally, if you need to have a single, self-contained executable you can rely on tclkit which will embed everything you need in a single executable.

P.S. I see from one of you comments that your on Windows. You can create Windows GUI directly in C (here is an old tutorial) but I can ensure you it's a real pain! If you want something more modern you have to switch to C++

Remo.D
  • 16,122
  • 6
  • 43
  • 74
  • Do we have any other frame works other than this because I have to implement it soon so can u suggest some easier frame work..??? – Jabin G George Apr 27 '13 at 17:32
  • IUP is rather simple (and you can benefit from his relationship with Lua so that you can create a Lua/C solution with an IUP interface). However, nothing I've seen is simpler than Tcl/Tk. You can do simple things simply and then move towards more complex interfaces. All the other GUI frameworks have a very steep learning curve. – Remo.D Apr 27 '13 at 17:37
-1

To develop your GUI, you could use GTK: https://developer.gnome.org/gtk-tutorial/2.90/ .

Adrian Panasiuk
  • 7,249
  • 5
  • 33
  • 54
  • thanks..!!Can i use visual C++ for the same.?? – Jabin G George Apr 27 '13 at 17:08
  • @JabinGGeorge sure! Although if Visual C++ studio is what you use, then you don't even have to use gtk: you can use the windows api http://www.dreamincode.net/forums/topic/207581-intro-to-the-windows-api/ (this is just part 1 of a series) – Adrian Panasiuk Apr 27 '13 at 21:22