Re: Redirecting stderr messages to a gnomeless widget.



On Wednesday, May 5, 2004, at 04:06 AM, raj090371 wrote:

How can I redirect STDERR messages to a gnome less widget or to a non editable text widget.Please help.

from the same app or from a child app?


from a child app is easy -- use shell redirection and an io watch. there's an example (without the redirection for stderr) in the faq:
http://gtk2-perl.sourceforge.net/faq/#46

you'd just do

   open IN, "child_program 2>&1 1>/dev/null";

instead, to send stdout to /dev/null and capture stderr. see the bash manpage (or whatever shell you're using) for more info.


from the same app can be a bit tricker. if you use Glib::Log's facilities for all your messages, you can use an arbitrary logging function to send the text wherever you want.

--
muppet <scott at asofyet dot org>




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