开发者

How do I override initWithContentRect in MacRuby?

开发者 https://www.devze.com 2023-01-21 01:14 出处:网络
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.

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

精彩评论

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