On Jan 20, 2010, at 9:43 AM, Kevin Wojniak wrote:

> NSWindow's standardWindowButton:forStyleMask: method works great for creating 
> these buttons and adding to my custom (frame) view. However, the mouse over 
> effect does not work without using undocumented methods. Mainly, overriding 
> _mouseInGroup: in the button's superview (frame view) and returning YES when 
> the mouse is over the buttons. This works, and I notice Google Chrome uses 
> the same method, but I really dislike using undocumented APIs like this, 
> especially for UI work. 

Funny you should point this out. I just found out the hard way that the code 
currently used in Chromium has some issues — it crashes on 'textured' windows 
for some reason. (Not currently a problem as Chromium has no textured windows, 
but I tried adding one the other day, and blammo.) So I wouldn't recommend 
anyone copy-and-paste it into their own project. Unfortunately it was the best 
solution the Chromium developers could come up with at the time … if anyone 
knows a better approach, we'd love to know.

(In Chromium's case, the window does use the standard frame, but moves the 
buttons down 3 pixels to better center them against the tabs.)

—Jens_______________________________________________

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 arch...@mail-archive.com

Reply via email to