 |
 |
cocoa show/hide nsbox or nsview in interface builder via a button
|
 |
|
 |
|
Registered User
Join Date: Feb 2003
Status:
Offline
|
|
I have 4 buttons in interface builder a mini toolbar in one area of my app. Question is how do I show/hide my 4 nsbox essentially I wish to have one nsbox always visible with the others almost underneath them. Almost like card-layout in swing. Click on the button and the corresponding nsbox comes to the front.
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Feb 2003
Location: USA
Status:
Offline
|
|
Since NSBox inherits from NSView you should be able to use setHidden:
[boxA setHidden:TRUE];
As far as the card layout bit I'm not sure...
|
|
MacBook 2.0 160/2GB/SuperDrive
Lots of older Macs
|
| |
|
|
|
 |
|
 |
|
Registered User
Join Date: Feb 2003
Status:
Offline
|
|
So it must be done programatically, - this is what I thought, but I was just hoping that it would have been possible in interface builder.
I will look it up.
|
|
|
| |
|
|
|
 |
|
 |
|
Registered User
Join Date: Feb 2003
Status:
Offline
|
|
The basic question still remains.
I have 4 NSView were to I place them in IB one on top of each other?? Now if I am using
[boxA setHidden:TRUE];
[boxB setHidden: FALSE];
[boxC setHidden:FALSE];
[boxD setHidden: FALSE];
the above will make boxA top and visible and then to show the third boxC as visible and top do I
[boxA setHidden: FALSE];
[boxB setHidden: FALSE];
[boxC setHidden: TRUE];
[boxD setHidden: FALSE];
To bring it to the front? Or is their a better way?
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status:
Offline
|
|
Sounds like you'd be better off with an NSTabView for your changeable UI area -- you can set it to unbordered and no tab-buttons in IB, and then have other controls whose actions call one of the -setSelectedTabViewItem... methods.
|
|
|
| |
|
|
|
 |
|
 |
|
Registered User
Join Date: Feb 2003
Status:
Offline
|
|
Many thanks Nick, sounds much easer - K
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status:
Offline
|
|
Remember: In Cocoa, you should not have overlapping sibling views. No guarantees are made as to the order in which they are drawn.
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Feb 2003
Location: USA
Status:
Offline
|
|
Originally posted by Rickster:
Sounds like you'd be better off with an NSTabView for your changeable UI area -- you can set it to unbordered and no tab-buttons in IB, and then have other controls whose actions call one of the -setSelectedTabViewItem... methods.
That is an awesome idea Rickster! Never thought of a tab view...I can actually make use of that idea in one of my apps. Thanks.
|
|
MacBook 2.0 160/2GB/SuperDrive
Lots of older Macs
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |