Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jpefjr

macrumors regular
Original poster
Jul 8, 2008
230
42
Does anyone have an example code for a drop-down toolbar item like the "Overview" drop-down in Xcode? And does anyone know if a toolbar item like that can be created in Interface Builder?
 
Doesn't look like you can set a toolbar item's view in IB, but you could create a generic one, connect it to an outlet and then in your awakeFromNib, set its view, along with its min and max size.
 
Thanks for the answer kainjnow. It looks like I can connect the Received Actions from my view to the items in the drop-down menu and I can create the drop-down menu in Interface Builder by following this example:

http://www.youtube.com/watch?v=Qr6EX-JIZZU

The one problem is it does not change the selected value for the drop-down menu automatically but I'm hoping a can find a "selected" method to call for the drop-down menu toolbaritem.
 
OK, I found the answer to auto-select the appropriate item. Instead of changing the NSPopUpButton's type to "Pull down" I left it as "Pop up" and everything work as expected.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.