File:  [NeXTSTEP 3.3 examples] / Examples / AppKit / Backspace / BlackView.m
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:48:31 2018 UTC (8 years, 1 month ago) by root
Branches: NeXT, MAIN
CVS tags: NeXTSTEP33, HEAD
Sample Programs from NeXSTEP 3.3

//  BlackView.m
//
//  You may freely copy, distribute, and reuse the code in this example.
//  NeXT disclaims any warranty of any kind, expressed or  implied, as to its
//  fitness for any particular use.


#import "BlackView.h"
#import <math.h>
#import <libc.h>
#import <dpsclient/wraps.h>

@implementation BlackView

// This is a really simple View that makes the screen totally black
// BackSpace wasn't really designed for this, so oneStep still gets
// invoked.  By sleeping, we insure that this doesn't suck too
// many cycles.  Has to wake often enough to remain moderately
// responsive to events.

- oneStep
{
	usleep(1000000 * 1/2 );			//sleep a while (yuck!)
	// this time should be short enough that BackSpace remains
	// somewhat responsive if an event does occur.  Unfortunately,
	// waking up keeps BackSpace hotter than I would prefer (ie paged in)

	return self;
}

- drawSelf:(const NXRect *)rects :(int)rectCount
{
	//Actually, this method doesn't have to do anything at all since
	// the view is placed in a black window...

	return self;
}

- (BOOL)isBoringScreenSaver
{
	return YES;
}

@end

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.