Matt Legend Gemmell Modesty is Lying

Mac OS X Cocoa and iPhone Development Services available at Instinctive Code.
Mac OS X Cocoa and iPhone Developer for hire

Other Pages

Categories

Posted
12 March 2006 @ 7pm

Categories
Development, Interface, Source

Tags
, , , , ,

HUDWindow

Another week, another custom window style no-one else bothered to make. This time, it’s a recreation of iPhoto’s “Adjust” palette, in the form of HUDWindow (an NSPanel subclass). Download the source code from my Cocoa Source Code page, and/or take a look at a screenshot.


8 Comments

Gus Mueller
13 March 2006 @ 1am

I took a quick look at the source- I guess you wern’t aware of NSWindow’s setMovableByWindowBackground:(BOOL) :)

You can strip out the mouseDown and mouseDragged stuff with that.

-gus


Uli Kusterer
13 March 2006 @ 2am

Are you planning to add the cool bevel/gradient/glass effect that this Window has in iPhoto? It’s a nice start, but it still looks rather flat. Also, I guess eventually there’d need to be all the custom controls to go with this window as well…


Matt
13 March 2006 @ 8am

Gus: Ah true. That was in there to limit dragging to the titlebar area, until I realised that iPhoto’s one allows you to drag it from anywhere. Good to know that the standard method works for borderless windows too.


Matt
13 March 2006 @ 8am

Uli, I’ve not seen iPhoto ‘06 in detail yet, and the window is flat in ‘05. I’ll take a look for screenshots online sometime.


Matt
13 March 2006 @ 4pm

I’ve updated the source now to remove the superfluous manual dragging code, and to just call -setMovableByWindowBackground:YES. I also had an unnecessary instance variable in there, which is now also gone.

Uli, regarding the “gradient/glass effect” you talk about, I got a friend to send me a screenshot of the Adjust palette in iPhoto ‘06, and it looks just like the one in iPhoto ‘05 (and thus like HUDWindow too). I guess you might mean something from Aperture instead. :)


Brian Ellis
11 May 2006 @ 7pm

Lovely little style! I do have one question though… seems like the window only gets a close widget if you create it programmatically like you do in your controller class in the example. If you create an NSPanel in Interface Builder and set its custom class to HUDWindow, it works exactly as it ought to except there’s no close widget. I’m not sure what the difference is between what you’re doing and what IB is doing to instantiate the window, but is there anything that can be done about this? :)


Matt
14 May 2006 @ 6pm

Source has been updated to address the issue Brian mentioned, by the way. Get it from the same link mentioned above.


Drarok
7 August 2006 @ 9pm

Now all we need is a whole suite of HUDControls. The Sliders, Buttons etc ;)

Great work though. Many thanks.


Leave a Comment

It’s snowing Now with added Flickr goodness