Cleaned up the uiWindow Darwin implementation. Let's try this again...
This commit is contained in:
parent
941825e190
commit
a850ea3ac5
|
@ -4,19 +4,6 @@
|
||||||
// TODO
|
// TODO
|
||||||
// - showing on size
|
// - showing on size
|
||||||
|
|
||||||
#ifdef uiLogAllocations
|
|
||||||
@interface loggingNSWindow : NSWindow
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation loggingNSWindow
|
|
||||||
|
|
||||||
uiLogObjCClassAllocations()
|
|
||||||
|
|
||||||
@end
|
|
||||||
#else
|
|
||||||
#define loggingNSWindow NSWindow
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@interface uiWindowDelegate : NSObject <NSWindowDelegate>
|
@interface uiWindowDelegate : NSObject <NSWindowDelegate>
|
||||||
@property uiWindow *w;
|
@property uiWindow *w;
|
||||||
@property int (*onClosing)(uiWindow *, void *);
|
@property int (*onClosing)(uiWindow *, void *);
|
||||||
|
@ -35,8 +22,10 @@ uiLogObjCClassAllocations()
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// after this method returns we assume the window will be released (see below), so we can go too
|
||||||
- (void)windowWillClose:(NSNotification *)note
|
- (void)windowWillClose:(NSNotification *)note
|
||||||
{
|
{
|
||||||
|
uiFree(self.w);
|
||||||
[self release];
|
[self release];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +49,7 @@ uiWindow *uiNewWindow(char *title, int width, int height)
|
||||||
|
|
||||||
w = uiNew(uiWindow);
|
w = uiNew(uiWindow);
|
||||||
|
|
||||||
w->w = [[loggingNSWindow alloc] initWithContentRect:NSMakeRect(0, 0, (CGFloat) width, (CGFloat) height)
|
w->w = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, (CGFloat) width, (CGFloat) height)
|
||||||
styleMask:(NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask)
|
styleMask:(NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask)
|
||||||
backing:NSBackingStoreBuffered
|
backing:NSBackingStoreBuffered
|
||||||
defer:YES];
|
defer:YES];
|
||||||
|
|
Loading…
Reference in New Issue