ftp.nice.ch/pub/next/tools/workspace/Broadcast.1.0.s.tar.gz#/Broadcast/BroadcastDaemon/Controller.m

This is Controller.m in view mode; [Download] [Up]

#import "Controller.h"
#import <shared.h>

@implementation Controller

/*=========================================================================
 * NAME        : appDidInit:
 * DESCRIPTION : Delegate message of Application.
 *=========================================================================*/
- appDidInit:sender
{
    // Move the application icon off screen
    [[NXApp appIcon] moveTo:-1000.0 :-1000.0];
    
    // Don't become the key application
    [NXApp deactivateSelf];

    return self;
}

/*=========================================================================
 * NAME        : broadcast:from:
 * DESCRIPTION : Delegate message from Listener.  This is a request to
 *		 pop up a panel with a message.
 *=========================================================================*/
- (int) broadcast:(char *)msg from:(char *)user
{
    //id thePanel = nil;
    char title[128];
    
    // Get rid of previous panel
    //if (thePanel) {
    //    [thePanel orderOut:self];
	//[thePanel free];
	//thePanel = nil;
   // }
    
    // Build title
    if (user && strlen(user))
        sprintf(title, "Alert from %s", user);
    else
        strcpy(title, "Alert");
	
    // Show panel
    if (msg && strlen(msg)) {
        NXRunAlertPanel(title, msg, "OK", NULL, NULL);
        //thePanel = NXGetAlertPanel(title, msg, NULL, NULL, NULL);
	//[thePanel orderFront:self];
    }
    return 0;
}

@end

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.