[net.micro.amiga] Some Help w/String Gadgets

rj@amiga.UUCP (06/15/86)

To those of you who have found the examples in the Intuition manual
to be sloppy, I apologize.  I tried, you know?

Same goes for Intuition in general.  Hey, I gave it a good shot.  I think
it's pretty good all in all.  But you know, I didn't finish it.  Just as 
we were coming up to the V1.1 release I split instead with my lovely 
bride on a serious, serious honeymoon.  First things first, you know?
Some of you know.

Jim Mackraz has done Intuition since then.  Jim is one of the people who 
proofed the Intuition manual (lightly) before it went to Addison Wesley.
Under Jim's tutelage, Intuition is coming up extremely well.  The things
that most of you have found bothersome about Intuition (and the
system in general) are modified and enhanced in V 1.2.  Those of you
who are Beta testers should *really* exercise that code and report any
bugs you find.  1.2 must make it out.

In article <401@cbmvax.cbmvax.cbm.UUCP> higgin@cbmvax.UUCP (Paul Higginbottom) writes:
>	It's unclear who is in charge of borders at any time.
>		This makes rendering into windows a constant battle.
>		Yes, I know, there's the wonderful GIMMEZEROZERO
>		windows - but they're abysmally slow and are memory
>		hogs.
>
In V 1.1 and earlier Intuitions, even Intuition was unclear about who was
in charge of borders.  The borders often were redrawn unnecessarily.  This
could screw up your own imagery.  Also, the only facility to redraw
a portion of the window without disturbing the border was to use
the dreaded GIMMEZEROZERO window, which scared many people away, as well
it should.

These problems are well fixed in V 1.2.  Intuition does many clever things
now to avoid redrawing things unnecessarily.  Intuition and Graphics
synchronize their operations much more intimately.  The Exec is better.
The DOS is really better.  And more.  So far, so great.

Also, there are new Graphics routines which allow you to do your own
clipping of a window, so the GIMMEZEROZERO window becomes obselete
for the most part, which is just as well because the name was  
just too cumbersome, doncha know.  At Amiga, they had a sign on the 
pegboard:  a red circle around a red diagonal slash that went through 
the word GIMMEZEROZERO.  I hope it's all that it should be.  I haven't 
tried the stuff yet myself.  

I used a modified version of Neil's region management routines 
(Workbench code) for data in the Sidecar windows.

>	Requesters go somewhat against the grain of multi-tasking.
>		There's no reason why other things must be BLOCKED
>		while they're around.  I'm glad this is remedied in
>		1.2, although I won't be using 1.2 routines for my
>		work.
>
Requesters are much improved in V 1.2.  If you are using 1.1, you must
contend with their limitations.  It's not too hard.

Sorry, but requesters block in 1.1.  You can create a borderless window 
instead and get any kind of input you like.  Lots of people do this under 
V 1.1.  

If you don't mind the fact that requesters block, requesters aren't too bad
under 1.1.  Lots of people use requesters.

Under V 1.2, requesters are much more efficient and much less expensive 
to use.

>Question - is there a quick way to update the screen (window) title
>without using SetWindowTitle() because I want to use it for status
>info which changes a lot, and using SetWindowTitle causes it to flash,
>splutter, and be basically very objectionable.  Any ideas would be
>appreciated.
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.

Hope this answers your questions.   RJ

higgin@cbmvax.cbm.UUCP (Paul Higginbottom) (06/16/86)

...
I Wrote:
>>Question - is there a quick way to update the screen (window) title
>>without using SetWindowTitle() because I want to use it for status
>>info which changes a lot, and using SetWindowTitle causes it to flash,
>>splutter, and be basically very objectionable.  Any ideas would be
>>appreciated.

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
be on top of it get munged instead.

Correct me if I'm wrong, please :-)

	Thanks, and I meant what I said before about Intuition - congrats.
Re: it's limitations - I know the time constraints you were under, too.

	Regards,
		Paul Higginbottom

Disclaimer: I do not work for Commodore and opinions expressed here are my own.

rj@amiga.UUCP (Robert J. Mical) (06/18/86)

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