Im pretty new to applescript and the Mac, and I made alittle program to skip ahead or behind in iTunes, and what Id like is to be able to move the close/min/zoom buttons to be verticle and to not have a window title so that it looks similar to when you hit the zoom button on iTunes.
I havent been able to find an option to do it in Interface builder and the extra space and cleaner look would be really helpful.
Am I just missing a setting somewhere?
No there is no setting in Interface Builder you haven’t found. As you have probably noticed, iTunes uses a window style that is not standard but it’s also not the textured look featured by interface builder. I guess the vertical close/min/zoom buttons might also a feature of this (new) style which Apple didn’t make public (yet?).
But there is a possible workaround:
The controls could simply be removed from the window (by unchecking the title bar controls checkboxes in Interface Builder) and placed manually instead. But then you still have the title bar where you can’t place any UI elements - iTunes doesn’t. To achieve this you’ll have to make your window borderless (NSBorderlessWindowMask) and use the textured option for it. The borderless part can’t be done with pure AppleScript afaik - you’ll have to use a NSWindow subclass for this and write some Objective-C. An example where this technique (and more) is shown is here: http://developer.apple.com/samplecode/RoundTransparentWindow/index.html
The second part for the iTunes style is the non standard and non textured window background (gradient). No - unfortunately there is also no missing checkbox for this … you’ll have to do this ‘by hand’. There are several people who have written different solutions to come as close as possible to this iTunes look (including me ) - here is a public one which looks nice and works ok and the author - Matt Gemmel - allows free use, even for commercial projects (see licence):
http://mattgemmell.com/source/ - look for the ‘TunesWindow’ code.
Hope that helps,
D.
As Dominik says, there is no way to get this functionality without writing it yourself in obj-c. The topic of using borderless/titleless windows has been covered (by me) a few times here at macscripter, too. I wrote a pretty comprehensive post on creating custom, draggable borderless windows in this thread. You will need to recreate your own titlebar and buttons (not too tough) for both variations of the window, as well as come up with a way to draw your own background.
Another method I thought might work would be to use two separate windows. Instead of actually resizing the big window into the small one, you could catch the should zoom action of each, override it, and then open the other window instead. Here’s a sample of what I mean…
on should zoom theObject proposed bounds proposedBounds
set nextWindow to "LittleWindow"
if name of theObject is "LittleWIndow" then set nextWindow to "BigWindow"
hide theObject
show window nextWindow
return false
end should zoom
Obviously, make sure that both the little window and the big window are connected to the “should zoom” handler in IB. In the small window, you’d could either use a titleless window, or you could place your custom buttons somewhere in the window that IB allows… eliminating the need for any subclassing of the window and the extra overhead that that creates.
You can contact me personally if you have a problems with the details, or customizing the code.
j