开发者

window:willPositionSheet:usingRect doesn't get called

I've a Cocoa window controller defined that's overriding the method for window:willPositionSheet, but when the dialog opens it doesn't get called.

- (NSRect)window:(NSWindo开发者_如何学Gow *)window willPositionSheet:(NSWindow *)sheet usingRect:(NSRect)rect
{
return rect;
}

An important fact, the dialog is a sheet and the parent is a Carbon window passed as a Cocoa reference when the sheet dialog is created.

Any ideas?

Thanks in advance


That is an NSWindow delegate method, so you'll need to set your window controller as the delegate of your window, either by connecting the window's delegate outlet to File's Owner in Interface Builder or by calling the window's ‑setDelegate: method.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜