Skip to content

Commit 57058d9

Browse files
committed
window: Flip all views by default.
1 parent c93457a commit 57058d9

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

flippedview.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#import <Cocoa/Cocoa.h>
2+
3+
@interface FlippedView : NSView
4+
5+
- (BOOL)isFlipped;
6+
7+
@end

flippedview.m

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#import "flippedview.h"
2+
3+
@implementation FlippedView
4+
5+
- (BOOL) isFlipped
6+
{
7+
return YES;
8+
}
9+
10+
@end

window.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#import "window.h"
22
#import "windowdelegate.h"
3+
#import "flippedview.h"
34
#include "_cgo_export.h"
45

56
WindowDelegate *gocoa_windowDelegate = nil;
@@ -11,6 +12,7 @@
1112
styleMask:(NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskResizable | NSWindowStyleMaskMiniaturizable)
1213
backing:NSBackingStoreBuffered
1314
defer:NO];
15+
[window setContentView: [[FlippedView alloc] initWithFrame:windowRect]];
1416
[window setTitle:[NSString stringWithUTF8String:title]];
1517
[window autorelease];
1618

@@ -27,6 +29,7 @@
2729
styleMask:(NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskResizable | NSWindowStyleMaskMiniaturizable)
2830
backing:NSBackingStoreBuffered
2931
defer:NO];
32+
[window setContentView: [[FlippedView alloc] initWithFrame:windowRect]];
3033
[window setTitle:[NSString stringWithUTF8String:title]];
3134
[window autorelease];
3235
CGFloat xPos = NSWidth([[window screen] frame])/2 - NSWidth([window frame])/2;

0 commit comments

Comments
 (0)