• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Need help : Multiple views in NSDrawer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Need help : Multiple views in NSDrawer


  • Subject: Need help : Multiple views in NSDrawer
  • From: kubernan <email@hidden>
  • Date: Tue, 23 Jul 2002 00:19:48 +0200

Hello,

I'd like to do some interesting things with my parent window and its drawer but
i have some difficulties :

The content of the drawer can have different views depending on what we select
in the parent window. For example :
Selection x in parent window --> open the drawer with the view x (and its content)
Selection y in parent window --> open the drawer with the view y "
Selection z in parent window --> open the drawer with the view z "

What i decided to do is to create 3 subclasses view, called (following the
example) x y and z.
I also create 3 controllers, each contains an outlet connected to the appropriate view :
controller x has the view x.

I generate the file for the controllers and the views.
Now i have to display the selected view in my drawer and this is where i have difficulties : the
selected view and its content doesn't appears in the drawer.

It seems i have to do something like that.

theParentWindowController.m

-(void)openMyDrawerWithXView
{
id selectedController = nil;
id viewX;
selectedController = [[[theXController alloc] init] retain];
viewX = [[IBView alloc] initWithFrame:[[myDrawer contentView] frame]];
[myDrawer setContentView:viewX];
[myDrawer open];
}

There are two problems :

1- As I said, the drawer seems to be empty :-(

2- Other thing i don't understand : I have a log message (NSLog) in the theXController init method. It appears the log message is displayed twice : first time when the parent window controller (the "main" controller) is loaded + after calling the openMyDrawerWithXView method.

For more informations :
==== theXController.h ====
{
IBOutlet IBView* aTestView;
}
-(testView *)aTestView;

==== theXController.m ====
- (id)init
{
self = [super init];
NSLog(@"Init - theXController");
return self;
}

-(IBView *)aTestView
{
return aTestView;
}

and :
==== IBView.m ===
- (id)initWithFrame:(NSRect)frame
{
self = [super initWithFrame:frame];
return self;
}

Thx for your help,
Regards,
K.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: How to control relative paths in Unix task?
  • Next by Date: Manual layout of controls?
  • Previous by thread: Re: How to control relative paths in Unix task?
  • Next by thread: Re: Need help : Multiple views in NSDrawer
  • Index(es):
    • Date
    • Thread