ftp.nice.ch/pub/next/developer/resources/classes/misckit/MiscKit.1.10.0.s.gnutar.gz#/MiscKit/Temp/ObjCategories.rtf

This is ObjCategories.rtf in view mode; [Download] [Up]

Copyright Ó 1993 John Karabaic

From: John_Karabaic@NeXT.COM (John Karabaic)
Date: Wed, 6 Oct 93 15:43:31 -0400
To: yackd@alaska.et.byu.edu (Don Yacktman)
Subject: Some hopefully useful code snippets...

Two useful things I came up with over the last couple of weeks.  Hope they help somebody.

/* HostPicker Method

Assumptions:

* you have an instance variable named hostField where you store the hostname.
*every hostname in every netinfo subdomain is accessible to your system.
*add libni_s.a to your libraries in ProjectBuilder.
*Connect a button to this and voila!
*/

- pickHostName:sender
{
	id	thePanel = [NIOpenPanel new];
	[thePanel setListTitle: "Machine Names"];
	[thePanel setPanelTitle: "Machine Name Picker" ];

	if ([thePanel runModal] == NX_OKTAG)
	{
		const char *fullDomain = [thePanel directory];
		if (fullDomain && *fullDomain){
			[hostField setStringValue: (char *)fullDomain];
			//[self changeHostName:self];
			//optional, add this method if you want to trigger the change.
		}
	}
	return self;
}



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