Removed TODOs about initial sizing of Windows and their Controls on Mac OS X; turns out we fixed that problem when we did our container NSView and overrode setFrameSize: :D

This commit is contained in:
Pietro Gagliardi 2014-08-11 12:40:41 -04:00
parent 61cd581ff4
commit 55f25afb49
1 changed files with 1 additions and 23 deletions

View File

@ -20,17 +20,6 @@
return windowClosing(self->gowin);
}
// TODO there has to be a better way
- (void)doWindowResize:(id)win
{
NSWindow *w;
NSRect r;
w = toNSWindow(win);
r = [[w contentView] frame];
[[w contentView] setFrameSize:r.size];
}
@end
id newWindow(intptr_t width, intptr_t height)
@ -78,8 +67,7 @@ void windowSetTitle(id win, const char * title)
void windowShow(id win)
{
[toNSWindow(win) makeKeyAndOrderFront:toNSWindow(win)];
// calling the above the first time won't emit a size changed event (unlike on Windows and GTK+), so fake one to get the controls laid out properly
windowRedraw(win);
// no need to worry about reshowing the window initially; that's handled by our container view (container_darwin.m)
}
void windowHide(id win)
@ -96,13 +84,3 @@ id windowContentView(id win)
{
return (id) [toNSWindow(win) contentView];
}
// fake a resize event under certain conditions; see each invocation for details
void windowRedraw(id win)
{
goWindowDelegate *d;
d = [toNSWindow(win) delegate];
[d doWindowResize:win];
// TODO new control sizes don't take effect properly, even with [toNSWindow(win) display];
}