PDA

View Full Version : Beginner question: Showing/hiding parts of window




breandan
Feb 26, 2008, 04:19 AM
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
Feb 26, 2008, 04:32 AM
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
Feb 26, 2008, 04:37 AM
Hi,

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

Thanks for your help.

Breandan.