Originally Posted by
spatika
I need to interface my C code into a GUI . i.e, ./<file> should open a new window and my application(C code) should run there.
Do you mean the program output in your terminal? Just use a shell script like this:
Code:
#!/bin/sh
Terminal --hide-menubar --hide-borders --geometry 129x37+0+0 -e /home/bin/myprogam
This will launch a seperate terminal window and start "myprogram" in it. It is just an example, the syntax for the gnome-terminal you are probably using in Ubuntu might be slightly different.
If you want a real GUI (using gtk), then you have to create an interface. You could just use a text area and pipe the output of a command into it; however, I will tell you from experience there is no advantage to doing this and there are a number of potentially serious disadvantages. Which is why *no one* really does that. Also, any kind of "terminal" in X windows is a GUI already; it runs a text console inside of it, so having another style of text window to do the same thing only worse would be redundant.
If you want to design an interface using gtk, you will have to think about what controls are needed, what kind of widgets to use for that, etc, and if there is text output from the program that you want seen, how you are going to display that. A read-only "textview" is one possibility. Probably you want to get a little more advanced and break that information up to exploit some different possibilities of the GUI, eg, a current connections list where you could click on a connection to get a little pop-up containing more detailed info. That's work; you'll have to keep going with those tutorials. I know there is a specific one for the text widget:
http://www.bravegnu.org/gtktext/