NSOpenPanel/NSSavePanel animation

Hi, ALL,

When I try to open file open or file save dialog inside Xcode is sliding down from the top.


When I try to do the same in my own program - those panels are animating from the center of the main frame.


For the open panel I call


[oPanel runModal];


and for the save panel I call


returnCode = [sPanel runModalForDirectory: ];


Is there anything I'm missing?


Thank you.

Replies

When I try to open file open or file save dialog inside Xcode is sliding down from the top.


Which XCode version ?

I tested the following in XCode 10.2.1:

- open a project

- call open… from File menu


The panel opens in the middle of the screen, directly, not sliding from top.


Can you describe how you get the sliding effect in XCode ?

Do you see the same sliding effect in other apps ?

Claude31,

I have Xcode 9 and in there when I select "File->Duplicate... the panel slides from the top.

But "File->Open does come from the middle of the screen.


Sorry about the confusion.

The "runModal" methods create an independent window, which gets a standard window opening animation. Panels that slide down from the top are actually sheets, and you get them by using the "beginSheet" variants of the methods:


https://developer.apple.com/documentation/appkit/nssavepanel/1535870-beginsheetmodal