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

breandan

macrumors newbie
Original poster
Feb 26, 2008
5
0
Hi,

I've just begun learning to develop using XCode & Cocoa (I come from a Windows development background), and I was wondering how to show/hide parts of a window?

e.g. On the left of the window, I have a list of different professions(Waiter, Fireman etc). When I click on one of them, I'd like the details to show up on the right. As all the professions have different 'details', the layout/amount of controls is different for each one.

In Windows development, this is normally done by having several panels (or a pageview) on top of each other, each one with its own set of controls. When you click on a profession, the appropriate panel is brought to the top.

Anyone know how this is handled in XCode/Cocoa?

Thanks for any information,

Breandan.
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
The old-school traditional way would be to use a tab-view with the tabs hidden. Then you simply change the tab programatically to change what is viewed. This is simple and effective.

The new-school, Leopard only funky way is to put each set of controls on a layer-backed view and set the visible property of the layers. You can then have them fade in/out to transition etc easily.
 

breandan

macrumors newbie
Original poster
Feb 26, 2008
5
0
Hi,

Its sounds like it’s fairly similar then; I'll try what you suggested.

Thanks for your help.

Breandan.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.