Tabs: Work in Interface Designer, but not in compiled program

Post: #1
I have placed a simple tabbed pane with three tabs in my window using Interface Designer. In each of these tabs I have placed a set of components. When I click the different tabs in Interface Designer, the current components are hidden and the components of the clicked tab appear - just as expected.

The problem appears when I build and run the application. Now all the components are visible at one time and it does not make any difference if I click any of the tabs. Why Is this? Will I have to hide and show the components on my own?

System: Panther 10.3.8, XCode - Carbon project.
Quote this message in a reply
Posts: 567
Joined: 2004.07
Post: #2

It's not magic, it's Ruby.
Quote this message in a reply
Posts: 14
Joined: 2004.07
Post: #3
Remember that you need to handle all the hiding and showing of the tabs yourself. When you open the dialog you need to make all the other tabs invisible, then when a tab is clicked you need to make the last one invisible and the new one visible.

Overall, handling tabs is much like handling other controls except that I found I needed to install a separate handler for the tabs themselves (can't actually remember why now) using InstallControlEventHandler(gTabControlRef, ...).

Take aquadot!red out for a spin
It sure ain't your grandpa's pacman!
Quote this message in a reply
Posts: 834
Joined: 2002.09
Post: #4
I have working source code for this. Drop me an email if you're interested. Smile
Quote this message in a reply
Post: #5
Nayr << Now why is it that tabs can not be used in a game or in a game tool? The goal of this project is to port some code which i wrote for windows in another project. The code is AI development tools and server apps.

radiance << So the controls are placed in containers, which I then show or hide - right? Or will I have to hide each and every control and keep track of which tab they're connected to?

Fenris << Sounds great. Incomming email.
Quote this message in a reply
Posts: 776
Joined: 2003.04
Post: #6
If you are starting a project from scratch (or in your case, porting from another platform), maybe you could save yourself some work by using Cocoa for the interface? The tabs for instance don't need any additional code to work as expected in Cocoa.
Quote this message in a reply
Post Reply