Problem with a splitterview...
Problem with a splitterview...
- Subject: Problem with a splitterview...
- From: Jiva DeVoe <email@hidden>
- Date: Tue, 18 Feb 2003 17:29:14 -0700
Hello, I'm having trouble with a splitterview which I am creating and
adding to programmatically (not in IB).
Specifically, when I add my subview to it (thus, causing it to split)
it disappears until I resize the window in some way. I thought maybe
this might be because I needed to call "setNeedsDisplay:YES" but I have
tried that on everything I can think of. I can't figure out the deal.
Here's my code where I create the subview and add it in (_splitView is
my NSSplitView as previously created - it is also a subview of
"_scrollView" which is an NSScrollView which is a subview of _box which
is an NSBox created in IB.):
-(IBAction)addSubview:(id)sender
{
MyCustomView *view = [[MyCustomView alloc]
initWithFrame:[_splitView bounds]];
NSScrollView *sv = [[NSScrollView alloc] initWithFrame:[_splitView
bounds]];
[sv setDocumentView:view];
[_splitView addSubview:sv];
[view setAutoresizingMask:(NSViewWidthSizable |
NSViewHeightSizable)];
[sv setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
[_splitView setNeedsDisplay:YES];
[_box setNeedsDisplay:YES];
[_scrollView setNeedsDisplay:YES];
[view setNeedsDisplay:YES];
}
HELP!
Here's my creation code, if that helps:
-(void)awakeFromNib
{
_scrollView = [[NSScrollView alloc] initWithFrame:[_box bounds]];
[_scrollView setHasHorizontalScroller:YES];
[_box setContentView:_scrollView];
_splitView = [[NSSplitView alloc] initWithFrame:[_scrollView
bounds]];
[_splitView setVertical:YES];
[_splitView setIsPaneSplitter:YES];
[_scrollView setDocumentView:_splitView];
[_box setAutoresizingMask:(NSViewWidthSizable |
NSViewHeightSizable)];
[_box setAutoresizesSubviews:YES];
[_scrollView setAutoresizingMask:(NSViewWidthSizable |
NSViewHeightSizable)];
[_scrollView setAutoresizesSubviews:YES];
[_splitView setAutoresizingMask:(NSViewWidthSizable |
NSViewHeightSizable)];
[_splitView setAutoresizesSubviews:YES];
}
_______________________________________________
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.