Create Multiple Image with Multiple select in Mac OS X 10.7
by Ryan Santos · 03/13/2012 (1:27 am) · 0 comments
This is a quick hack for those experiencing the same problem as I do. Basically upgrading to OS X 10.7 with XCode 4.2, the multi-file selection breaks and doesn't work for my TGB 1.7.6. When you want to create an image map and you select multiple files (images), it always takes the last file from the selection and create only 1 x ImageMap.
This is because many of the functions are deprecated in > 10.6 and one of it is causing the open dialog to return only 1 x filename even if multiple files are selected.
You need to modify the following file, platformMacCarb/macCocoaDiaogs.mm and search for this function
and search for this line
Replace by
Cheers :)
This is because many of the functions are deprecated in > 10.6 and one of it is causing the open dialog to return only 1 x filename even if multiple files are selected.
You need to modify the following file, platformMacCarb/macCocoaDiaogs.mm and search for this function
NSArray* _MacCocoaCreateAndRunOpenPanel(FileDialogData &mData)
and search for this line
if(button != NSFileHandlingPanelCancelButton)
[array addObject:[panel filename]];
return array;Replace by
if(button != NSFileHandlingPanelCancelButton)
{
// 2012 mickey > fix multi select bug due to deprecate function of filename
//[array addObject:[panel filename]];
NSArray* files = [panel filenames];
int kk=0;
for( kk = 0; kk < [files count]; kk++ )
{
[array addObject:[files objectAtIndex:kk]];
// Do something with the filename.
}
}
return array;Cheers :)
