The interpreter popup was never filled with any data, fixed.

Fixes #775878.
This commit is contained in:
Jack Jansen 2004-07-16 12:36:02 +00:00
parent 6e3b425f3f
commit 122f87fa04
2 changed files with 11 additions and 4 deletions

View File

@ -7,7 +7,7 @@
@interface PreferencesWindowController : NSWindowController <FileSettingsSource>
{
IBOutlet NSPopUpButton *filetype;
IBOutlet NSTextField *interpreter;
IBOutlet NSComboBox *interpreter;
IBOutlet NSButton *honourhashbang;
IBOutlet NSButton *debug;
IBOutlet NSButton *verbose;

View File

@ -29,6 +29,7 @@
{
// [[self window] setTitle: script];
[interpreter reloadData];
[interpreter setStringValue: [settings interpreter]];
[honourhashbang setState: [settings honourhashbang]];
[debug setState: [settings debug]];
@ -97,17 +98,23 @@
// NSComboBoxDataSource protocol
- (unsigned int)comboBox:(NSComboBox *)aComboBox indexOfItemWithStringValue:(NSString *)aString
{
return [[settings interpreters] indexOfObjectIdenticalTo: aString];
NSArray *interp_list = [settings interpreters];
unsigned int rv = [interp_list indexOfObjectIdenticalTo: aString];
return rv;
}
- (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(int)index
{
return [[settings interpreters] objectAtIndex: index];
NSArray *interp_list = [settings interpreters];
id rv = [interp_list objectAtIndex: index];
return rv;
}
- (int)numberOfItemsInComboBox:(NSComboBox *)aComboBox
{
return [[settings interpreters] count];
NSArray *interp_list = [settings interpreters];
int rv = [interp_list count];
return rv;
}