mac: Add win.beginSheet(sheet)/endSheet(sheet) API

This commit is contained in:
Cheng Zhao 2016-06-18 22:53:41 +09:00
parent 2c5f4aadfb
commit f2cbd7cb36
6 changed files with 38 additions and 0 deletions

View file

@ -964,6 +964,18 @@ void NativeWindowMac::SetParentWindow(NativeWindow* parent) {
[parent->GetNativeWindow() addChildWindow:window_ ordered:NSWindowAbove];
}
void NativeWindowMac::BeginSheet(NativeWindow* sheet) {
[window_ beginSheet:sheet->GetNativeWindow()
completionHandler:^(NSModalResponse) {
}];
}
void NativeWindowMac::EndSheet(NativeWindow* sheet) {
sheet->Hide();
[window_ endSheet:sheet->GetNativeWindow()];
sheet->CloseImmediately();
}
gfx::NativeWindow NativeWindowMac::GetNativeWindow() {
return window_;
}