Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!princeton!caip!topaz!harvard!ut-sally!pyramid!amiga!rj From: rj@amiga.UUCP (Robert J. Mical) Newsgroups: net.micro.amiga Subject: Re: Some Help w/String Gadgets Message-ID: <1311@amiga.amiga.UUCP> Date: Wed, 18-Jun-86 13:37:04 EDT Article-I.D.: amiga.1311 Posted: Wed Jun 18 13:37:04 1986 Date-Received: Sat, 21-Jun-86 07:13:21 EDT References: <431@batcomputer.TN.CORNELL.EDU> <1285@amiga.amiga.UUCP> Reply-To: rj@amiga.UUCP (Robert J. Mical) Organization: =RJ Mical= Lines: 55 Keywords: String Gadgets, Requesters In article <409@cbmvax.cbmvax.cbm.UUCP> higgin@cbmvax.UUCP (Paul Higginbottom) writes: >RJ replied: >>Sure. You know where you want the text to go, so go write it to your >>window using the Text() routine or whatever equivalent you use. >>But first, Forbid() and then write your text string into the title buffer >>that you specified with your OpenWindow() or your most recent >>SetWindowTitle() call. That way, if Intuition later does one of its many >>window border refreshes, the title of your choice will get drawn. >>Finally, Permit() and you're ready to call Text() just in case Intuition >>doesn't do a border redraw soon enough for you. > >I think what you're saying RJ is fine for WINDOW titles, but not the >SCREEN Title. The only way I can see to change that is with SetWindowTitle(). >If I use Text() to WRITE into the Screen's RastPort, then Windows that might You're right. I have a different suggestion to make concerning Screen titles. This is an unusual suggestion, so don't use this until Jim Mackraz (current Intuition guru) blesses this idea. You can use the same trick as described above, except you have to do some magic first. This *won't* work with the Workbench screen. You must be using a custom screen for this technique. Here's what you can do... After you open your Screen, copy the entire RastPort structure of the Screen into a RastPort structure of your own. struct Screen *screenptr; struct RastPort rport; screenptr = OpenSCreen(); rport = screenptr->RastPort; Then copy the screen title-bar layer into your own RastPort: rport->Layer = screenptr->BarLayer; Now you should be able to use this RastPort for your calls to Text(). The text that you print will not overwrite windows that may be over the screen title bar. When you save the text to a buffer, save it to the Screen structure's Title buffer. This is tricky, because you will be competing with menu operations for use of the screen title bar. This means that you have to use MENUVERIFY or some other preemptive measure to make sure that the screen is not in menu mode when you go blasting the text into the title bar. Remember, don't count on this until Jimm has his say. There is a flaw in my original scheme, by the way. It won't cause the machine to crash, but it may make for unsightly displays. I suggested that you surround the buffer write with the loving arms of Forbid() and Permit(). However, unless Intuition too surrounds its access to that buffer (it may, but I don't know), then you might manage to change the buffer just as Intuition is halfway through looking at it. No problem, unless you change the position of the terminating NULL and Intuition's call to the Text() routine ends up looking off into space for the end of the string. Like I said, this won't crash the machine, but you might end up with junk in the title bar. RJ