+
+ sliders = [NSMutableArray arrayWithCapacity:numBlendshapes];
+ NSStackView *stackView = [NSStackView stackViewWithViews:sliders];
+
+ for (int i = 0; i < numBlendshapes; i++) {
+ NSSlider *slider = [NSSlider sliderWithTarget:self
+ action:@selector(sliderMoved:)];
+ [slider setTag:i];
+ sliders[i] = slider;
+
+ NSTextField *label = [NSTextField labelWithString:names[i]];
+ NSStackView *rowStackView =
+ [NSStackView stackViewWithViews:@[ label, slider ]];
+ [stackView addView:rowStackView inGravity:NSStackViewGravityTop];
+ }
+
+ NSButton *solveButton = [NSButton buttonWithTitle:@"Solve weights"
+ target:self
+ action:@selector(solveWeights:)];
+ NSButton *resetButton = [NSButton buttonWithTitle:@"Reset weights"
+ target:self
+ action:@selector(resetWeights:)];
+ NSStackView *buttonStack =
+ [NSStackView stackViewWithViews:@[ solveButton, resetButton ]];
+ [stackView addView:buttonStack inGravity:NSStackViewGravityTop];
+
+ NSButton *manipsButton =
+ [NSButton buttonWithTitle:@"Reset Manipulators"
+ target:self
+ action:@selector(resetManipulators:)];
+ [stackView addView:manipsButton inGravity:NSStackViewGravityTop];
+
+ NSButton *animCheckbox =
+ [NSButton checkboxWithTitle:@"Play animation"
+ target:self
+ action:@selector(animationPlayback:)];
+ [stackView addView:animCheckbox inGravity:NSStackViewGravityTop];
+
+ [stackView setOrientation:NSUserInterfaceLayoutOrientationVertical];
+ [stackView setEdgeInsets:NSEdgeInsetsMake(16, 16, 16, 16)];
+ _view = stackView;
+