# Cocoa Toolbar Question



## rhale1 (Jul 21, 2002)

Hello all:

I have an app. I won't say what it does ('cause I don't know yet!), but it has a toolbar. This toolbar has an item that is composed of an NSView with some buttons (like in Fire's Online-On and Offline-Customize or the Finder's Icon-List-Column items). When I click the buttons, the main window switches views using the same animation method System Prefs or OW uses. All works well, except for the toolbar disapears; at least the items, anyway. The only way to get them back is to hide and then show the toolbar.

To make this short, anyone know how to refresh the toolbar? I tried looking in the Developer Help, but it didn't seem to find anything.

BTW: I posted some pics and a movie to show this. Click here to see them.

Thanks in advance:
Ryan


----------



## kainjow (Jul 22, 2002)

Hmm, that's weird. I have a program that uses a toolbar and changes the window's contentView each time a toolbar item is pressed, but it does work all the time. How big is your code? Maybe it's something with your code...


----------



## rhale1 (Jul 22, 2002)

My code's not too big, just MyDocument.m and MyDocument.h

I'll post the toolbar code, there is probably something I need to do (I'm still learning).

Kainjow, if you could post the code/app you have I can compare how the contentView changes.


----------



## kainjow (Jul 22, 2002)

I just used the tutorials at http://www.oreillynet.com/pub/a/mac/2002/02/15/cocoa.html and http://www.oreillynet.com/pub/a/mac/2002/03/15/cocoa.html and then mixed them together.


----------

