
#import <appkit/appkit.h>
#import "STKeyPanel.h"

@implementation STKeyPanel

- setDefaultButton:aButton
{	defaultButton=aButton;
	return self;
}

- _reflectChangeInKeyStatusTo:(BOOL)isKeyWindow
{
	if(!defaultButton) return self;
	if (isKeyWindow) [defaultButton setIconPosition:NX_ICONRIGHT];
    else [defaultButton setIconPosition:NX_TITLEONLY];
    return self;
}

- keyDown:(NXEvent *)e
{	//printf("in window keyDown\n");
	return self;
}

- miniaturize:sender
{	/*  it is necessary to override this method because
		the window by default does not send 'updateWindows'
		message
     */

	[super miniaturize:sender];
	[NXApp perform:@selector(updateWindows) with:nil
	   afterDelay:1 cancelPrevious:YES];
	return self;
}	
@end
