Re: Newbie. Creating SubViews that aren't associated with NSWindow, or NSPanel?
Re: Newbie. Creating SubViews that aren't associated with NSWindow, or NSPanel?
- Subject: Re: Newbie. Creating SubViews that aren't associated with NSWindow, or NSPanel?
- From: "aaron smith" <email@hidden>
- Date: Wed, 10 Dec 2008 23:35:46 -0800
Thanks Carlos, that should work too.
On Wed, Dec 10, 2008 at 6:11 PM, Carlos Eduardo Mello
<email@hidden> wrote:
> Maybe I 'm getting all this wrong, but from everything I read on this
> thread, apparently the OP wants to do something simple and is trying to do
> more work than necessary:
>
> "Now what I want to do is show/hide view1/view2 depending on which
> button you click. What I'm confused about is achieving "tab" like
> behavior, without using a tab view."
>
> So Aaron,
>
> why don't you just go in IB, create a window, place your toolbar/buttons and
> layout both views directly on your window, add outlets to them + actions to
> the buttons in your app controler, and then just hide/show the
> correspondding views in the action code? It doesn't really answer your
> original question, but maybe solves what you declared you want to do.
>
> (something along these lines...)
>
> <untested-incomplete code>
>
> @interface // ...
> {
> IBOutlet NSView * _view1;
> IBOutlet NSView * _view2;
> }
> - (IBAction)switchToView1;
> - (IBAction)switchToView2;
> @end
>
> // ...
>
> - (IBAction)switchToView1
> {
> [ _view2 setHidden:YES ];
> [ _view1 setHidden:NO ];
> // ...
> }
>
> - (IBAction)switchToView2
> {
> [ _view1 setHidden:YES ];
> [ _view2 setHidden:NO ];
> // ...
> }
>
> </untested-incomplete code>
>
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden