From c0534f0107f339eb3e6991e0bf5e745ded6512c7 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Wed, 9 Jun 2021 00:11:25 -0400 Subject: [PATCH] auto-resize views to match launch window view sizes. --- Ample/LaunchWindowController.m | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Ample/LaunchWindowController.m b/Ample/LaunchWindowController.m index da8d5d9..4831b41 100644 --- a/Ample/LaunchWindowController.m +++ b/Ample/LaunchWindowController.m @@ -163,16 +163,20 @@ static int EffectsIndex(NSString *str) { [self reset]; } +static void AddSubview(NSView *parent, NSView *child) { + + [child setFrame: [parent bounds]]; + [parent addSubview: child]; +} - (void)windowDidLoad { [super windowDidLoad]; // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file. + AddSubview(_slotView, [_slotController view]); + AddSubview(_mediaView, [_mediaController view]); + AddSubview(_machineView, [_machineViewController view]); - [_slotView addSubview: [_slotController view]]; - [_mediaView addSubview: [_mediaController view]]; - [_machineView addSubview: [_machineViewController view]]; - NSArray *keys = @[ //@"mameMachine", // - handled