OT: capturing stdout & stderr to a GtkText



Hello wizards,

this is not directly related to GTK+, but a) I really knew no other place to
ask, and b) I'm building a GTK+ application that need this. In my app
there's a window with a couple of GtkText's in it. One is used by the user
to enter commands and the other to display the results of those commands.

Currently, I have Perl embedded to process whatever the user types (yup,
it's possible to enter anything that Perl digs as ok, and it will executed.)
However, if I enter "print 2;" the Perl interpreter will print 2 but on a
terminal. How can I capture the stdout and stderr output of an embedded
program like Perl? If I can capture, it'll be no problem adding it to the
GtkText.

Thanks a lot,
--
carlos carnero | vfx artist | texel rtvc com cu





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]