2021-01-23 12:25:40 +03:00
|
|
|
|
|
|
|
@implementation MyView2
|
|
|
|
|
2021-04-14 03:59:34 +03:00
|
|
|
int xx = 0;
|
|
|
|
|
2021-01-23 12:25:40 +03:00
|
|
|
// Alternative drawRect which calls a frame function with native Cocoa calls
|
|
|
|
- (void)drawRect:(NSRect)rect {
|
2021-04-14 03:59:34 +03:00
|
|
|
puts("drawRect()");
|
|
|
|
if (xx == 0) {
|
|
|
|
_sapp_call_init();
|
|
|
|
xx = 1;
|
|
|
|
}
|
|
|
|
_sapp_call_frame_native();
|
2021-01-23 12:25:40 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
//- (BOOL)isOpaque {
|
|
|
|
// return NO;
|
|
|
|
//}
|
|
|
|
|
|
|
|
- (BOOL)canBecomeKeyView {
|
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
- (BOOL)acceptsFirstResponder {
|
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
|
2021-02-17 08:56:58 +03:00
|
|
|
// - (void)mouseExited:(NSEvent*)event {
|
|
|
|
// }
|
2021-01-23 12:25:40 +03:00
|
|
|
|
2021-02-17 08:56:58 +03:00
|
|
|
// - (void)mouseDown:(NSEvent*)event {
|
|
|
|
// }
|
2021-01-23 12:25:40 +03:00
|
|
|
|
|
|
|
- (BOOL)acceptsFirstMouse:(NSEvent *)event {
|
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|