On Wed, 7 Mar 2001 22:11:45 -0500, Morbus Iff wrote:

>This is what I hope to accomplish. Can someone help me out?
>
> a) Redirect STDOUT to the window. Newlines need apply, and
>    autoscrolling would be helpful. I *do not* want to use
>    a Console window - I've already seen the trick of opening
>    a pipe to Dev:Console. Font doesn't matter.

The way you can do something like this is with a tied filehandle. Create
a package with appropriate subs for TIEHANDLE and PRINT, tie a typeglob
("*FILE") to it, and print to this filehandle (it may be the default
output handle, see select()). TIEHANDLE must simply return a properly
blessed reference. For each print statement, the PRINT sub will be
called. This one can then take the output-for-print, and paint it in the
window. You'll have to take of newlines yourself, but in this package.
See perltie ("Tied Objects", under "Advanced Topics") for more details.

I'm sorry, I have virtually no experience in programming the Mac GUI
from within MacPerl, so on that end, you mustn't expect any help from
me; not even a working example.

-- 
        Bart.

Reply via email to