Custom Views (NSTextField) in NSToolbar Items?

Discussion in 'Mac Programming' started by MorphingDragon, Sep 21, 2010.

  1. macrumors 603

    MorphingDragon

    Joined:
    Mar 27, 2009
    Location:
    The World Inbetween
    #1
    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.
     
  2. macrumors newbie

    Joined:
    Sep 10, 2010
    #2
    For people who stumble on this topic looking for answers, you need to look at the setView: method in NSToolbarItem.

    MT
     
  3. thread starter macrumors 603

    MorphingDragon

    Joined:
    Mar 27, 2009
    Location:
    The World Inbetween
    #3
    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. :/
     

Share This Page