Beginner question: Showing/hiding parts of window

Discussion in 'Mac Programming' started by breandan, Feb 26, 2008.

  1. breandan macrumors newbie

    Feb 26, 2008

    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,

  2. robbieduncan Moderator emeritus


    Jul 24, 2002
    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.
  3. breandan thread starter macrumors newbie

    Feb 26, 2008

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

    Thanks for your help.


Share This Page