This is HostSpinView.m in view mode; [Download] [Up]
/*
* Module:
* HostSpin
*
* Author:
* Doug "Kareth" McClure
* asd@cc.purdue.edu
* XASD@PURCCVM.BITNET
*
* Version: 1.0
*/
#import "HostSpinView.h"
#import "Thinker.h"
#import "HostSpinWraps.h"
#import <appkit/NXImage.h>
#import <appkit/Window.h>
#import <appkit/Panel.h> // for NXRunAlertPanel()
#import <dpsclient/wraps.h>
#import <libc.h>
#import <math.h>
@implementation HostSpinView
- oneStep
{
static int rota = 0;
static float currentSpectrum = 0.0;
currentSpectrum += 0.01;
if ( currentSpectrum > 1.0 )
{
currentSpectrum = 0.0;
}
PSsethsbcolor(currentSpectrum, 1.0, 1.0);
PSsendstring(hostName);
PSsendint(rota);
PSsendfloat(ySize);
PSsendfloat(xSize);
psHostSpinRun();
rota += 2;
if ( rota > 360 )
{
rota = 0;
}
return self;
}
- initFrame:(NXRect *)frameRect
{
[super initFrame:frameRect];
[self newSize];
gethostname(hostName, 128);
return self;
}
- sizeTo:(NXCoord)width :(NXCoord)height
{
[super sizeTo:width :height];
[self newSize];
return self;
}
- newSize
{
xSize = bounds.size.width;
ySize = bounds.size.height;
return self;
}
@end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.