? GS-accessoryView.patch ? PRICE.app ? PRICE.pcproj.backup ? obj ? PRICE.pcproj/multix.project Index: MyDocument.m =================================================================== RCS file: /cvsroot/price/PRICE-osx/MyDocument.m,v retrieving revision 1.80 diff -u -r1.80 MyDocument.m --- MyDocument.m 7 Oct 2012 20:22:08 -0000 1.80 +++ MyDocument.m 8 Oct 2012 13:46:54 -0000 @@ -366,8 +366,24 @@ [windowController changeSaveType:sender]; } + +/* we override this for GNUstep */ +- (NSInteger) runModalSavePanel: (NSSavePanel*)savePanel withAccessoryView: (NSView*)accessoryView + +{ + NSLog(@"runModalSavePanel: withAccessoryView. We should see this only on GS"); + [windowController setCompressionType:[self fileType]]; + [windowController prepareSavePanel: savePanel]; + + /* we finally call super, but reget the accessory view since we changed it */ + return [super runModalSavePanel:savePanel withAccessoryView:[savePanel accessoryView]]; +} + + +/* we override this for Cocoa */ - (BOOL) prepareSavePanel:(NSSavePanel *) panel { + NSLog(@"prepareSavePanel"); [windowController setCompressionType:[self fileType]]; return [windowController prepareSavePanel: panel]; } Index: PRWindowController.m =================================================================== RCS file: /cvsroot/price/PRICE-osx/PRWindowController.m,v retrieving revision 1.29 diff -u -r1.29 PRWindowController.m --- PRWindowController.m 7 Oct 2012 20:22:09 -0000 1.29 +++ PRWindowController.m 8 Oct 2012 13:46:54 -0000 @@ -292,15 +292,29 @@ savePanel = panel; NSLog (@"prepareSavePanel, original accessory view class: %@", [[panel accessoryView] class]); - originalContentView = [(NSBox *)[panel accessoryView] contentView]; + + /* Cocoa uses a NSBox, GNUstep does not */ + if ([[panel accessoryView] isKindOfClass:[NSBox class]]) + originalContentView = [(NSBox *)[panel accessoryView] contentView]; + else + originalContentView = [panel accessoryView]; + [originalContentView setFrameOrigin:NSMakePoint(0, 40)]; NSLog(@"original content view: %@", originalContentView); NSLog(@"new options view: %@", saveOptionsView); /* views coming froma NIB window need a retain */ [saveOptionsView retain]; - /* extract the view from the NSBox, add the content of the original accessory view */ - newContentView = [(NSBox *)saveOptionsView contentView]; + + /* Cocoa uses a NSBox, GNUstep does not, we reflect this in the respective GORM and NIB file */ + if ([saveOptionsView isKindOfClass:[NSBox class]]) + { + /* extract the view from the NSBox, add the content of the original accessory view */ + newContentView = [(NSBox *)saveOptionsView contentView]; + } + else + newContentView = saveOptionsView; + [newContentView addSubview:originalContentView]; [panel setAccessoryView:newContentView];