What is wrong with my view ?
What is wrong with my view ?
- Subject: What is wrong with my view ?
- From: kubernan <email@hidden>
- Date: Sat, 29 Jun 2002 16:07:02 +0200
Hello,
I'm trying to add a view to my modal window without success :the view
doesn't appear.
My nib file contains my main window, my modal window and my view.
The main window is connected to a controller. The view is associated to
another one.
main window controller : searchWindowController
view controller : searchCriterionsView
searchCriterionsView is a subclass of NSView and connected to
searchWindowController via the outlet called theSearchView.
my modal window is also connected to an outlet called queryBuilder.
Thx for your help
Here's the code :
@interface searchWindowController : NSObject // main controller
{
IBOutlet id window;
IBOutlet id queryBuilder; // the window opened in modal mode
IBOutlet searchCriterionsView *theSearchView;
}
@implementation searchWindowController
<skip -(id)init >
- (void)awakeFromNib
{
[[queryBuilder contentView] addSubview:theSearchView]; // <- Want to
add subview to the modal window (queryBuilder)
[[self window] makeKeyAndOrderFront:nil];
[self showSearchCriterianWindow:self]; // Open the modal window
}
-(IBAction)showSearchCriterianWindow:(id)sender
{
[NSApp beginSheet:queryBuilder
modalForWindow:window
modalDelegate:nil
didEndSelector:nil
contextInfo:nil];
[NSApp runModalForWindow:queryBuilder];
[NSApp endSheet:queryBuilder];
[queryBuilder orderOut:self];
}
The view source code :
@interface searchCriterionsView : NSView
{
}
@end
#import "searchCriterionsView.h"
@implementation searchCriterionsView
- (id)initWithFrame:(NSRect) frameRect
{
self = [super initWithFrame:frameRect];
NSLog(@"Hello"); // Displayed in the log, but the view doesn't
appear in the window
[self setNeedsDisplay:YES];
return self;
}
@end
_______________________________________________
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.