view src/video/quartz/SDL_QuartzWindow.m @ 56:ce9cd2cf0d0d

Date: Sun, 10 Jun 2001 17:33:44 -0500 From: Darrell Walisser <dwaliss1@purdue.edu> Subject: Re: [SDL] Mac OS X Goodies For You Updates and fixes: -fixed erasing window when minmizing it (with some minor window redraw problems) -implemented close box to send SDLQuit event -fixed messed up alpha on 32bpp windows
author Sam Lantinga <slouken@lokigames.com>
date Mon, 11 Jun 2001 00:08:10 +0000
parents 45b1c4303f87
children bd6b0a910a65
line wrap: on
line source

/* Subclass of NSWindow to allow customization if we need it */

@interface SDL_QuartzWindow : NSWindow
{}
- (void)miniaturize:(id)sender;
- (void)deminiaturize:(id)sender;
- (void)display;
@end

@implementation SDL_QuartzWindow

/* These methods should be rewritten to fix the miniaturize bug */
- (void)miniaturize:(id)sender
{
    [ super miniaturize:sender ];
}

- (void)deminiaturize:(id)sender
{
    [ super deminiaturize:sender ];
}

- (void)display
{
    /* Do nothing to keep pinstripe pattern from drawing */
}
@end

/* Delegate for our NSWindow to send SDLQuit() on close */
@interface SDL_QuartzWindowDelegate : NSObject
{}
- (BOOL)windowShouldClose:(id)sender;
@end

@implementation SDL_QuartzWindowDelegate
- (BOOL)windowShouldClose:(id)sender {

    SDL_Event event;
    event.type = SDL_QUIT;
    SDL_PushEvent(&event);
    return NO;
}
@end