🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.next.programmer
2 messages
2 total messages Started by Manuel Alberto Ricart Sun, 03 Jan 1993 07:35
Setting the UNIX Preferences from a service
#2011
Author: Manuel Alberto Ricart
Date: Sun, 03 Jan 1993 07:35
10 lines
1008 bytes
I usually find myself bringing in the UNIX preferences to toggle the UNIX Expert  
flag. I grow ever so tired of doing something that I should be able to toggle in  
an easier form. Doing it from a service is a way. The problem is finding the  
undocumented method to call...

Is there a way of messaging the Workspace to be in UNIX Expert mode?
(Is there a way of finding out what messages the Listener responds to?)
-- 
Manuel Alberto Ricart
alberto@parsec.mixcom.com <NeXTMail Welcome>
Re: Setting the UNIX Preferences from a service
#2180
Author: Bob Vadnais
Date: Tue, 05 Jan 1993 00:59
36 lines
1859 bytes
In article <1993Jan3.073519.1235@parsec.mixcom.com> 
alberto@parsec.mixcom.com (Manuel Alberto Ricart) writes:
>
> Is there a way of messaging the Workspace to be in UNIX
> Expert mode? (Is there a way of finding out what messages
> the Listener responds to?)  

I'm not sure if there's an officially documented way to do it,
but there's no black magic involved and it's not very complicated.
All you need to do is set the preference in the defaults database,
then use the NXWorkspaceRequestProtocol method to notify the 
workspace that the defaults database changed.  

The following function should do just that.

void setUnixExpert(BOOL expert) 
/* Requires NS3.0 or greater (for NXWorkspaceRequestProtocol) */
{
  const char *unixExpertValue = NXGetDefaultValue("System", "UnixExpert");
  const char *newUnixExpertValue = expert ? "No" : "Yes";
  BOOL changeDefault = (unixExpertValue == NULL) || 
                (strcasecmp(unixExpertValue, newUnixExpertValue));
   
  if (changeDefault) {
    NXWriteDefault("System", "UnixExpert", newUnixExpertValue);
    [[Application workspace] defaultsChanged];
  }
  
}

Cheers,
Bob
--
Bob_Vadnais@pdh.com (NeXT Mail welcome)
PDH Inc., 2635 North First Street Suite 224, San Jose, CA 95134-2034
Voice: (408)428-9596  Fax: (408)428-9599
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads