🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #1160

Re: Tracking the currentdocument

#1160
From: Chris Lloyd
Date: Sat, 15 Aug 1992 04:48
56 lines
2326 bytes
In article <1992Aug15.023340.28812@monu6.cc.monash.edu.au> ede978e@monu6.cc.monash.edu.au (Robert D. Nicholson) writes:
>- drawSelf:(NXRect *)rects :(int)count
>{
>
>    Room *highlightedRoom;
>        

Get rid of this erase, it's pointless since you do a composite with COPY
right after it which just blasts over the fill.

>  /* erase update rect since the nximage might be smaller than our bounds */
>
>    PSsetgray(NX_WHITE);
>    NXRectFill(&rects[0]);


>    [image composite:NX_COPY
>              fromRect:&rects[0]
>              toPoint:&rects[0].origin];
>                

This doesn't make sense, you want to draw for THIS window (the one the view
is in), not the current document window. If you have one document, the current
document will be this window, if you dont, you want to draw for the window this
document/view is IN, not the current one.

>    highlightedRoom = [[NXApp currentDocument] currentHighlightedRoom];

     highlightedRoom = [[window delegate] currentHighlightedRoom];

No need to bother with the check's currentDocument do.

>    if (highlightedRoom) {
>        NXRect intersectRect;
>        NXRect *intersects;
>                                
>        [highlightedRoom scaledRoomRect:&intersectRect];
>        intersects = NXIntersectionRect(&rects[0],&intersectRect);
>        if (intersects) {
>            NXHighlightRect(&intersectRect);
>        }
>    }
>       
>    return self;
>}
>
[...]
>What are the common uses of windowDidResignKey and windowDidResignMain when
>applied to apps that have global inspectors.

Disabling/enabling items and updating fields in the inspector to reflect
the current document/window or lack thereof.

la la la,
-- 
:: Christopher Lloyd :: a74k110@titan.ucc.umass.edu :: Yrrid, Inc. ::
Technical Details
Message-ID: <1992Aug15.044803.13242@nic.umass.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!caen!nic.umass.edu!titan.ucc.umass.edu!a74k110
References: <1992Aug15.023340.28812@monu6.cc.monash.edu.au>

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!caen!nic.umass.edu!titan.ucc.umass.edu!a74k110
From: a74k110@titan.ucc.umass.edu (Chris Lloyd)
Subject: Re: Tracking the currentdocument
Message-ID: <1992Aug15.044803.13242@nic.umass.edu>
Sender: usenet@nic.umass.edu (USENET News System)
Nntp-Posting-Host: titan.ucc.umass.edu
Organization: University of Massachusetts, Amherst
References: <1992Aug15.023340.28812@monu6.cc.monash.edu.au>
Date: Sat, 15 Aug 1992 04:48:03 GMT
Lines: 56