On 2014-11-18 09:07:10 +0000, Christian Schneider said:
This is what I came up with so far:
override KeyboardView initWithFrame(NSRect frame) [initWithFrame:] {
//my stuff
return cast(KeyboardView) super.initWithFrame(frame) ;
}
Why not use a constructor and let the compiler manage the boilerplate?
this(NSRect frame) [initWithFrame:] {
//my stuff
super(frame);
}
This should emit the same code as the function above (but I haven't
tested). And then you can write:
auto view = new KeyboardView(someFrame);
and have proper type safety.
--
Michel Fortin
michel.for...@michelf.com
http://michelf.com/