PDA

View Full Version : Custom Views (NSTextField) in NSToolbar Items?




MorphingDragon
Sep 21, 2010, 08:03 AM
I would like to get an NSTextField into an NSToolbar, sort of like the Address Bar in Safari. How could I do this? (I've considering layering a view over it but that defeats the purpose of having a customisable toolbar)

I know that there's the Search Field item, but thats already used for another function.

EDIT: Never mind, I found some Apple sample code.



munit
Sep 21, 2010, 03:49 PM
For people who stumble on this topic looking for answers, you need to look at the setView: method in NSToolbarItem.

MT

MorphingDragon
Sep 21, 2010, 09:53 PM
For people who stumble on this topic looking for answers, you need to look at the setView: method in NSToolbarItem.

MT

Well now I'm thoroughly pissed. I spent hours finding and writing code and this morning I find a way to drag views into the toolbar using IB. :/