Re: Achieve the Blur background as in Dock menus.
Re: Achieve the Blur background as in Dock menus.
- Subject: Re: Achieve the Blur background as in Dock menus.
- From: Gustavo Pizano <email@hidden>
- Date: Fri, 1 Jan 2010 20:50:02 +0100
Joar hello.
mmm.. well.. Its a custom NSView, which is drawing all 9 images to generate the menu bounds, same as in the Dock, Im trying to recreate that menu for my application. All images are are .png with transparency value. So its not an NSMenu, because this custom menu Im displaying when clicking a special part of the window.
> It might not be as bad as it sounds. Using CGWindowListCreateImage() + kCGWindowListOptionOnScreenBelowWindow could be all that you need. This API is pretty accessible and easy to use. I would expect for you to be able to get something working in a couple of hours. You should be able to get the window of the menu from the view when it's asked to draw. Not sure if there's anything in the timing of the display of the menu view that would make this more difficult than it appears.
MM I will check this...
thanks for the help :)
Gustavo
On Jan 1, 2010, at 8:23 PM, Joar Wingfors wrote:
>
>
> On 1 jan 2010, at 08.37, Gustavo Pizano wrote:
>
>> First Im using the method NSDrawNinePartImage to draw the box that appears when click an item, this receives NSImages, so I thought that applying a CIfilter to a CIImage then converting the CIImage into a NSImage and send to the NSDrawNinePartImage method will do the trick.. but of course this doesn't happen.
>
>
> What doesn't happen? I'm not sure if you're supposed to get the blurred background for free when using menu item views, but it sounds like a reasonable expectation if you're drawing something that's not opaque. You are drawing non-opaque images, right? Please file a bug report / enhancement request if you feel that the menu item view drawing should work differently:
>
> <http://developer.apple.com/bugreporter/>
>
>
> On 1 jan 2010, at 09.47, Gustavo Pizano wrote:
>
>> OUCH!!!
>> that hurts! :(.
>
>
>
> It might not be as bad as it sounds. Using CGWindowListCreateImage() + kCGWindowListOptionOnScreenBelowWindow could be all that you need. This API is pretty accessible and easy to use. I would expect for you to be able to get something working in a couple of hours. You should be able to get the window of the menu from the view when it's asked to draw. Not sure if there's anything in the timing of the display of the menu view that would make this more difficult than it appears.
>
>
> j o a r
>
>
_______________________________________________
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