protected void OnNewClicked(object sender, System.EventArgs e) { using (NewInstanceDialog newDlg = new NewInstanceDialog(this)) { newDlg.ParentWindow = this.GdkWindow; newDlg.Response += (sender1, e1) => { if (e1.ResponseId == ResponseType.Ok) { Console.WriteLine("Adding inst " + newDlg.InstDir); using (Instance inst = new Instance(newDlg.InstName, newDlg.InstDir, true)) { instList.AppendValues(inst.Name, inst); LoadInstances(); } } newDlg.Destroy(); }; newDlg.Run(); } }
protected void OnNewClicked(object sender, System.EventArgs e) { NewInstanceDialog newDlg = new NewInstanceDialog(this); newDlg.ParentWindow = this.GdkWindow; newDlg.Show(); newDlg.OKClicked += (sender1, e1) => { Console.WriteLine("Adding inst " + newDlg.InstDir); Instance inst = new Instance(newDlg.InstName, newDlg.InstDir, true); instList.AppendValues(inst.Name, inst); }; }