So when i click on an item on the toolbar, i want it to show different things then the other button, but in one window.
I haven’t ever tried this so I can’t say for sure but here’s what I would try. I have 3 suggestions for you. One of them should work the way you want.
For the first method I would put a tab view in my window. I would place the contents of your normal window in the first tab view item. Then when the button is clicked I would have that button actually switch to the second tab view item where you can have other content that you want to show. If you make it so the actual tab view items do not show it will look like the window content changes when in actuality all you are doing is switching between tabs.
A second method would be to create a second window in your project. Make that window so that it doesn’t automatically become visible when your program launches. If you do this then essentially you have an invisible window running when your application starts. This invisible window could hold the content of what you want your main window to look like when the button is pressed. Then when you press the button in the main window you can get the position and size of it, set the position and size of the invisible window to that… then make the main window invisible and make the invisible window visible.
A third method would be to set up the invisible window as I explained in the second method. But you can swap the contents of the 2 windows when the button is pressed… thus making the main window have the contents that you want. The following code will place the contents of the invisible window onto the main window. You’ll have to play with it to get it to do exactly as you want.
call method "setContentView:" of window "mainWindow" with parameter (call method "contentView" of window "invisibleWindow")
ok i’ll try these out. An example application that has what i’m looking for is Cocktail.