[comp.sys.mac.programmer] Color windows in LSC

hardie@ndmath.UUCP (Hardie Tankersley) (04/14/89)

I'm having trouble getting to my window's portPixMap with (imageWindow->portPixMap)
and variations on this theme.  The window is declared 'WindowPtr imageWindow',
so maybe it doesn't treat it like a color window.  But LSC refuses to let me declare
a CWindowPtr or CWindowRecord.  The only related color structure LSC seems to know
about is a CGrafPort.  But it won't let me cast my window pointer dereferenced into
a CGrafPort. (i.e. ((CGrafPtr)*imageWindow)->portPixMap).
 
Can someone please help me find my poor lost portPixMap?
 
Thanks,

beard@ux1.lbl.gov (Patrick C Beard) (04/18/89)

In article <1360@ndmath.UUCP> hardie@ndmath.UUCP (Hardie Tankersley) writes:
>I'm having trouble getting to my window's portPixMap with 
>(imageWindow->portPixMap)
>and variations on this theme.  The window is declared 'WindowPtr imageWindow',
>so maybe it doesn't treat it like a color window.  But LSC refuses to let me 
>declare a CWindowPtr or CWindowRecord.  The only related color structure LSC 
>seems to know about is a CGrafPort.  But it won't let me cast my window pointer
>dereferenced into >a CGrafPort. (i.e. ((CGrafPtr)*imageWindow)->portPixMap).
> 
>Can someone please help me find my poor lost portPixMap?
> 

The problem is in your example:  ((CGrafPtr)*imageWindow)->portPixMap
can't possibly work.  The correct cast is:  (*(CGrafPtr)imageWindow).portPixMap,
or ((CGrafPtr)imageWindow)->portPixMap.  You are right in that you do need
to cast to a CGrafPtr, but you better be sure that you create the window
with NewCWindow or GetNewCWindow  or this cast will produce nonsense.


__________________

   Patrick Beard
  PCBeard@lbl.gov
 BSI, Berkeley, CA
___________________