How to show NSWindow as a sheet in a specific place

I have a window that has 3 routines, each of which has a button. When I click on them - I need to show the sheet.

enter image description here

enter image description here

Using this code, the sheet enters the center of the window.

- (IBAction)closeSubWindow:(id)sender{
    [NSApp endSheet:self.subWindow];
    [self.subWindow orderOut:nil];

}

- (IBAction)showSubWindow:(id)sender {
    [NSApp beginSheet:self.subWindow
       modalForWindow:self.window
        modalDelegate:self
       didEndSelector:nil
          contextInfo:nil];
}

Is there any option or way to show the sheet in certain coordinates?

EDIT:

My current implementation is done with NSPopover. Can I do this NSPopoverfor animation as a sheet?

0
source share
2 answers

Take a look at the delegate method NSWindow -window:willPositionSheet:usingRect:

+3
source

, . , . , , , , , , NSPopover. OSX 10.7 / . ( ) , ( popover, ). , OK .

, , , .

0

All Articles