And after that, you can either uses NSImage but it's not really nice, or create a NSView subclass to do your drawing.

I had to do this myself and want to share some knowledge.

Actually, the notification windows is 161 points wide, and 156 points high (with 1 point = 1 pixel when use scale factor = 1) without shadow. This is a rounded rect with a radius of 25 pixels, filled using a black color with alpha set to 0.15.
And the window frame origin is center for x, and 140 points for y.

[[NSColor colorWithCalibratedWhite:0 alpha:0.15] setFill];
[[NSBezierPath bezierPathWithRoundedRect:NSMakeRect(0, 0, 161, 156) xRadius:25 yRadius:25] fill];

Le 3 mai 08 à 04:19, Jamie Phelps a écrit :

You might also check out the RoundedFloatingPanel code from Matt Gemmell: http://mattgemmell.com/source about 60% of the way down.

JP

On May 2, 2008, at 3:38 AM, John Clayton wrote:

Hi All,

Does anyone know of some code that mimics the graphics that are displayed by Apple when one modifies the system volume? Specifically the grey box + white shadowed text that pops up briefly. I want to do something similar in my app, so any kind of guiding code would be useful.

Any info about the box or code that emulates this would be useful,

Thanks!

--
John Clayton
http://www.coderage-software.com/



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/jrphelps%40mac.com

This email sent to [EMAIL PROTECTED]

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/devlists%40shadowlab.org

This email sent to [EMAIL PROTECTED]


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to