NSOpenGLView: fix resising when loaded from nibs

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29956 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Eric Wasylishen 2010-03-15 00:11:11 +00:00
parent 4c75baa42b
commit c2610af4ff
2 changed files with 33 additions and 0 deletions

View file

@ -1,3 +1,14 @@
2010-03-14 Eric Wasylishen <ewasylishen@gmail.com>
* Source/NSOpenGLView.m:
Add an -initWithCoder: implementation which subscribes to
the frame change notifications like -init.
Without this addition, NSOpenGLViews loaded from nibs
weren't resizing properly.
Note: it should also probably set a pixel format, but I
didn't add that because it was causing an error.
2010-03-15 Fred Kiefer <FredKiefer@gmx.de>
* Source/GSXibLoader.m: New file with basic XIB format

View file

@ -249,6 +249,28 @@ static NSOpenGLPixelFormatAttribute attrs[] =
}
}
- (id) initWithCoder: (NSCoder *)aCoder
{
self = [super initWithCoder: aCoder];
// FIXME: Should set a pixel format like -init does
[[NSNotificationCenter defaultCenter]
addObserver: self
selector: @selector(_frameChanged:)
name: NSViewGlobalFrameDidChangeNotification
object: self];
[self setPostsFrameChangedNotifications: YES];
[[NSNotificationCenter defaultCenter]
addObserver: self
selector: @selector(_frameChanged:)
name: NSViewFrameDidChangeNotification
object: self];
return self;
}
@end