public override void ViewDidLoad() { base.ViewDidLoad(); rootViewController = (ViewController)NSApplication.SharedApplication.MainWindow.ContentViewController; config = rootViewController.config; settings = rootViewController.settings; settingIndex = rootViewController.settingIndex; planetIndex = (int)OrbsCombo.SelectedIndex; for (int i = 0; i < 10; i++) { NSString obj = new NSString(settings[i].dispName); SettingsCombo.Add(obj); } SettingsCombo.SelectItem(settingIndex); if (planetIndex == -1) { planetIndex = 0; OrbsCombo.SelectItem(planetIndex); } ReRender(); }
public override void ViewDidLoad() { base.ViewDidLoad(); rootViewController = (ViewController)NSApplication.SharedApplication.MainWindow.ContentViewController; config = rootViewController.config; rootViewController = (ViewController)NSApplication.SharedApplication.MainWindow.ContentViewController; config = rootViewController.config; settings = rootViewController.settings; settingIndex = rootViewController.settingIndex; if (RingsCombo == null) { planetIndex = 0; } else { planetIndex = (int)RingsCombo.IndexOfSelectedItem; } SettingsCombo.RemoveAllItems(); for (int i = 0; i < 10; i++) { NSString obj = new NSString(settings[i].dispName); SettingsCombo.AddItem(obj); } SettingsCombo.SelectItem(settingIndex); RingsCombo.SelectItem(planetIndex); ReRender(); }