Article View: comp.sys.amiga.tech
Article #11455Re: window help
From: Mike (I'll think of something ye...
Date: Wed, 15 Feb 1989 20:47
Date: Wed, 15 Feb 1989 20:47
35 lines
2181 bytes
2181 bytes
In article <23793@pbhya.PacBell.COM> hbit@pbhya.PacBell.COM (Henry Bitter) writes: <I am trying to get a small C program working that is using both Intuition and <DOS. My problem is after creating my own screen and window the output that is <created using printf commands still goes to the workbench screen and window. This is a pretty common request. As far as I can tell, the answer is "you can't get there from here." At least not with what is provided by CBM. First thing: you're almost certainly never going to be able to use printf itself. fprintf is doable, under certain conditions. If your C compiler supports dup() fdup(), or something similar, you might be able to go from fprintf to printf. It's not clear you want to, though. The canonical answer is "use sprintf() and Text()." You call sprintf instead of printf, giving it a charater buffer to output to, then use Text() to print the characters in your window. As an alternative, you can use conman. It's shareware, and on one of the Fish disks. Using it, you can fopen() a CON: (if you've isntalled it as CON:) or CNC: (if you wish to leave the standard console handler in place) window, giving it the address of a window structure to attach itself to. The result of that fopen will be a FILE * you can hand to fprintf Now, if someone knows of a way supported by CBM of getting a FileHandle pointing to a window after you've opened a file, that would very usefull. I'd like to see it if you know how. <mike -- So this is where the future lies Mike Meyer In a beer gut belly; In an open fly mwm@berkeley.edu Brilcreamed, acrylic, mindless boys ucbvax!mwm Punching, kicking, making noise mwm@ucbjade.BITNET
Technical Details
Message-ID:
<20428@agate.BERKELEY.EDU>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!eris.berkeley.edu!mwmReferences:
<23793@pbhya.PacBell.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!eris.berkeley.edu!mwm From: mwm@eris.berkeley.edu (Mike (I'll think of something yet) Meyer) Newsgroups: comp.sys.amiga.tech,comp.sys.amiga Subject: Re: window help Message-ID: <20428@agate.BERKELEY.EDU> Date: 15 Feb 89 20:47:00 GMT References: <23793@pbhya.PacBell.COM> Sender: usenet@agate.BERKELEY.EDU Organization: Missionaria Phonibalonica Lines: 35