开发者

How do I override initWithContentRect in MacRuby?

I want to override initWithContentRect on a subclassed NSWindow, as I've seen done in Obj-C, in order to create a borderless window from a nib.

If I try this:

class GroupWindow < NSWindow
def initWithContentRect(contentRect, styleMask:windowStyle, backing:bufferingType, defer:deferCreation)
    super.initWithContentRect(
        contentRect,
        styleMask:NSBorderlessWindowMask,
        backing:bufferiMacngType,
        defer:deferCreation)
end
end

Then it 开发者_Python百科terminates with EXC_BAD_ACCESS

If I try this:

    def initWithContentRect(contentRect, styleMask:windowStyle, backing:bufferingType, defer:deferCreation)
    super(
        contentRect,
        styleMask:NSBorderlessWindowMask,
        backing:bufferingType,
        defer:deferCreation)
end

Then it just exits with return code 1.


You should do:

super(contentRect, NSBorderlessWindowMask, bufferingType, deferCreation)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜