• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
RE: L-shaped custom view in Cocoa?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: L-shaped custom view in Cocoa?


  • Subject: RE: L-shaped custom view in Cocoa?
  • From: Shawn Bakhtiar <email@hidden>
  • Date: Thu, 05 May 2011 13:59:44 -0400
  • Importance: Normal

What? It does too work! Once the window is setup correctly.

This is how a do all my transparent windows, and for any naysayers out there here is the code:
http://www.inksystemsinc.com/images/lshaped_window_proof.tar.gz

It is obviously not as simple as the two sudo lines of code I put there, but I was trying not write the damn things for him, and set him on the write path instead, as I'm sure with the Transparent window samples available on the net and in the docs he can manage to figure out how to setup the window and view for this to work, and now instead of him figuring it out (learning to fish), I did it for him and it took me all but 5 minutes using code I already had written (you made me toss him fish instead, just to show it CAN be done) :)

Filling a rect DOES NOT NUKE anything, you simply need to override the defaults which are optimized for rectangular non transparencies areas to make them faster. It's not that they can't its just faster not too, so that is the default.



> Date: Wed, 4 May 2011 18:02:56 -0700
> Subject: Re: L-shaped custom view in Cocoa?
> From: email@hidden
> To: email@hidden
> CC: email@hidden
>
> On Wed, May 4, 2011 at 1:09 PM, Shawn Bakhtiar <email@hidden> wrote:
> > Actually you only need one view. Subclass it, and over ride the draw method
> >
> >
> >
> > [[NSColor clearColor] set]
> > NSFillRect(...) <- the size you want to clear out.
> >
>
> Don't do this. It doesn't do what you think it does.
>
> The window only has one backing store bitmap. All normal views are
> drawn into this bitmap in order. So filling a rect with clearColor
> actually nukes the background of the window. It'll draw as a black
> rectangle on your screen.
>
> --Kyle Sluder
 		 	   		  _______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: L-shaped custom view in Cocoa?
      • From: Kyle Sluder <email@hidden>
References: 
 >Re: L-shaped custom view in Cocoa? (From: Bertil Holmberg <email@hidden>)
 >RE: L-shaped custom view in Cocoa? (From: Shawn Bakhtiar <email@hidden>)
 >Re: L-shaped custom view in Cocoa? (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: objects and "global / shared data"
  • Next by Date: Re: L-shaped custom view in Cocoa?
  • Previous by thread: Re: L-shaped custom view in Cocoa?
  • Next by thread: Re: L-shaped custom view in Cocoa?
  • Index(es):
    • Date
    • Thread