diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c
index 1383225..8c483ec 100644
a
|
b
|
typedef struct { |
34 | 34 | NSMutableArray *fileTypeExtensions; // array of allowed extensions per name, e.g. "txt", "doc" |
35 | 35 | NSMutableArray *fileTypeLabels; // displayed string, e.g. "Text document (.txt, .doc)" |
36 | 36 | NSMutableArray *allAllowedExtensions; // set of all allowed extensions |
37 | | NSInteger fileTypeIndex; // index of currently selected filter |
| 37 | NSUInteger fileTypeIndex; // index of currently selected filter |
38 | 38 | } filepanelFilterInfo; |
39 | 39 | |
40 | 40 | filepanelFilterInfo filterInfo; |
… |
… |
static NSURL *getFileURL(NSString *directory, NSString *filename) { |
270 | 270 | - (void)selectFormat:(id)sender { |
271 | 271 | NSPopUpButton *button = (NSPopUpButton *)sender; |
272 | 272 | filterInfo.fileTypeIndex = [button indexOfSelectedItem]; |
273 | | NSMutableArray *allowedtypes = filterInfo.fileTypeExtensions[filterInfo.fileTypeIndex]; |
| 273 | NSMutableArray *allowedtypes = [filterInfo.fileTypeExtensions objectAtIndex:filterInfo.fileTypeIndex]; |
274 | 274 | [openpanel setAllowedFileTypes:allowedtypes]; |
275 | 275 | filterInfo.userHasSelectedFilter = true; |
276 | 276 | |
… |
… |
static NSURL *getFileURL(NSString *directory, NSString *filename) { |
279 | 279 | - (void)saveFormat:(id)sender { |
280 | 280 | NSPopUpButton *button = (NSPopUpButton *)sender; |
281 | 281 | filterInfo.fileTypeIndex = [button indexOfSelectedItem]; |
282 | | NSMutableArray *allowedtypes = filterInfo.fileTypeExtensions[filterInfo.fileTypeIndex]; |
| 282 | NSMutableArray *allowedtypes = [filterInfo.fileTypeExtensions objectAtIndex:filterInfo.fileTypeIndex]; |
283 | 283 | [savepanel setAllowedFileTypes:allowedtypes]; |
284 | 284 | } |
285 | 285 | |
… |
… |
Tk_GetOpenFileObjCmd( |
717 | 717 | #if 0 |
718 | 718 | NSLog(@"result: %i modal: %li", result, (long)modalReturnCode); |
719 | 719 | #endif |
720 | | NSString * selectedFilter = filterInfo.fileTypeNames[filterInfo.fileTypeIndex]; |
| 720 | NSString * selectedFilter = [filterInfo.fileTypeNames objectAtIndex:filterInfo.fileTypeIndex]; |
721 | 721 | Tcl_ObjSetVar2(interp, typeVariablePtr, NULL, |
722 | 722 | Tcl_NewStringObj([selectedFilter UTF8String], -1), TCL_GLOBAL_ONLY); |
723 | 723 | } |
… |
… |
Tk_GetSaveFileObjCmd( |
884 | 884 | |
885 | 885 | [savepanel setAccessoryView:accessoryView]; |
886 | 886 | |
887 | | [savepanel setAllowedFileTypes:filterInfo.fileTypeExtensions[filterInfo.fileTypeIndex]]; |
| 887 | [savepanel setAllowedFileTypes:[filterInfo.fileTypeExtensions objectAtIndex:filterInfo.fileTypeIndex]]; |
888 | 888 | [savepanel setAllowsOtherFileTypes:NO]; |
889 | 889 | } else if (defaultType) { |
890 | 890 | /* If no filetypes are given, defaultextension is an alternative way |
… |
… |
Tk_GetSaveFileObjCmd( |
971 | 971 | #if 0 |
972 | 972 | NSLog(@"result: %i modal: %li", result, (long)modalReturnCode); |
973 | 973 | #endif |
974 | | NSString * selectedFilter = filterInfo.fileTypeNames[filterInfo.fileTypeIndex]; |
| 974 | NSString * selectedFilter = [filterInfo.fileTypeNames objectAtIndex:filterInfo.fileTypeIndex]; |
975 | 975 | Tcl_ObjSetVar2(interp, typeVariablePtr, NULL, |
976 | 976 | Tcl_NewStringObj([selectedFilter UTF8String], -1), TCL_GLOBAL_ONLY); |
977 | 977 | } |