Skip navigation.
 
mlRe: 2) Trasparent Window with Opaque Text
FROM : Lorenzo
DATE : Thu Oct 14 15:32:50 2004

Yes, sorry, the superview is really the NSClipView.

> IIRC, you need to replace the NSClipView drawing method with your own.

The problem is that I don't know how.
I am actually trying to update the whole window at any key pressed,
unsuccessfully. I made this in the NSTextView subclass:


- (void)textViewDidChangeTypingAttributes:(NSNotification *)aNotification
{
    // I have tried all the 3 ways here, unsuccessfully.

    [self setNeedsDisplay:YES];
    [[[self window] contentView] setNeedsDisplay:YES];
    [[self window] update];
}


Also, what's IIRC?


Best Regards
--
Lorenzo
email: <email_removed>

> From: stephane sudre <<email_removed>>
> Date: Thu, 14 Oct 2004 14:57:36 +0200
> To: Lorenzo <<email_removed>>
> Cc: cocoadev <<email_removed>>
> Subject: Re: 2) Trasparent Window with Opaque Text
>
>
> On Oct 14, 2004, at 2:23 PM, Lorenzo wrote:
>

>> Hi list,
>> after trying several ways, I have set my window transparent, the
>> NSTextView
>> transparent, and its NSScrollView transparent, so now the final effect
>> is an
>> opaque text-string over other objects on the screen. Almost fine. Two
>> new
>> problems occur now.
>>
>> 1) When I click on a transparent area of the Window (where there is no
>> text), the window is deselected and the object just under the window
>> becames
>> selected. Wrong.
>>
>> 2) When I write the Text or resize the window, I get noise around the
>> text.

>
> It's probably not noise but the shadow of the window.
>

>>
>> How can I fix these 2 problems? Thank you.
>>
>> Currently I do this:
>> --------------------
>>    [aWindow setBackgroundColor:[NSColor clearColor]];
>>    [aWindow setOpaque:NO];
>>    [[aTextView superview] setDrawsBackground:NO]; //the NSScrollView

>
> I would not bet a lot on the superview being a NSScrollView. IIRC, it's
> a NSClipView.
>

>>    [aTextView setDrawsBackground:NO];

>
> IIRC, you need to replace the NSClipView drawing method with your own.
>

Related mailsAuthorDate
ml2) Trasparent Window with Opaque Text Lorenzo Oct 14, 14:23
mlRe: 2) Trasparent Window with Opaque Text stephane sudre Oct 14, 14:57
mlRe: 2) Trasparent Window with Opaque Text Lorenzo Oct 14, 15:32
mlRe: 2) Trasparent Window with Opaque Text Adrian Milliner Oct 15, 00:04