private void addInput() { var inputBox = new VBox(false, 0); var inputFrame = new Frame("Input"); var inputScroll = new ScrolledWindow(); inputScroll.VscrollbarPolicy = PolicyType.Automatic; inputScroll.HscrollbarPolicy = PolicyType.Never; inputView = new TextView(); inputScroll.Add(inputView); inputFrame.Add(inputScroll); var updateButton = new Button("Update Format View"); updateButton.Clicked += (object sender, EventArgs args) => { if (formatScroll.Children.Length > 0) { formatScroll.Remove(formatScroll.Child); } var document = TextFormatter.CreateDocument( inputView.Buffer.Text ); var newFormatDisplay = documentToVBox(document); formatScroll.Add(newFormatDisplay); AppWindow.Instance.ShowAll(); }; inputBox.PackStart(inputFrame, true, true, 0); inputBox.PackStart(updateButton, false, false, 0); PackStart(inputBox, true, true, AppSettings.Margin); }