Skip to content

Commit

Permalink
OSX 10.5/ppc compat
Browse files Browse the repository at this point in the history
setStyleMask is 10.6 or later
  • Loading branch information
x42 committed Jul 27, 2015
1 parent 6004048 commit 69651d7
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions pugl/pugl_osx.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,9 @@ - (id)initWithContentRect:(NSRect)contentRect
defer:(BOOL)flag
{
NSWindow* result = [super initWithContentRect:contentRect
styleMask:(NSClosableWindowMask |
NSTitledWindowMask |
NSResizableWindowMask)
backing:NSBackingStoreBuffered defer:NO];
styleMask:aStyle
backing:bufferingType
defer:NO];

[result setAcceptsMouseMovedEvents:YES];
return (RobTKPuglWindow *)result;
Expand Down Expand Up @@ -412,7 +411,17 @@ - (void) flagsChanged:(NSEvent*)event
initWithBytes:title
length:strlen(title)
encoding:NSUTF8StringEncoding];
id window = [[RobTKPuglWindow new]retain];
NSRect frame = NSMakeRect(0, 0, min_width, min_height);
NSUInteger style = NSClosableWindowMask | NSTitledWindowMask;
if (resizable) {
style |= NSResizableWindowMask;
}
id window = [[[RobTKPuglWindow alloc]
initWithContentRect:frame
styleMask:style
backing:NSBackingStoreBuffered
defer:NO
] retain];
[window setPuglview:view];
[window setTitle:titleString];
[window setContentMinSize:NSMakeSize(min_width, min_height)];
Expand All @@ -429,9 +438,6 @@ - (void) flagsChanged:(NSEvent*)event
[NSApp activateIgnoringOtherApps:YES];
[window makeFirstResponder:impl->glview];
[window makeKeyAndOrderFront:window];
if (!resizable) {
[window setStyleMask:[window styleMask] & ~NSResizableWindowMask];
}
}
return view;
}
Expand Down

0 comments on commit 69651d7

Please sign in to comment.