Click to See Complete Forum and Search --> : Text view widget in glade under linux
Vanishree
05-02-2007, 02:32 AM
i want to display the terminal output in text view widget in glade (linux)using c code. I have used the button click event for that.But my terminal output is dynamic text means the output of the program is dynamic(infinite text). Please give solution... Its very urgent.
Vanishree
05-02-2007, 09:42 AM
How to display the continuously running text from terminal to text view widget in glade using c code under Linux. Give me the solution.
je_fro
05-02-2007, 10:07 AM
double posting is against the forum rules
bwkaz
05-02-2007, 06:56 PM
This sounds a lot like more homework, so I'll just point you in the direction I'd go.
Look into either pseudo-terminals (which are what the various X-based terminal emulators use so that the shell that they run works correctly), or look into pipes. Either will give you a file descriptor that you can read from to get the output from the program. (Pseudo-terminals also let you write to that FD and have that show up as input to the program; pipes require another pipe for this direction.)
Once you get the output from the command, you can drop it into the text-view widget line by line. I'd look for however gtk lets you get notified when a file descriptor is readable (GIOChannel perhaps?), and use that event to update the widget. Or however you end up organizing the data.