Previous Book Contents Book Index Next

Inside Macintosh: Interapplication Communication /
Chapter 4 - Responding to Apple Events / Interacting With the User


Setting the Server Application's User Interaction Preferences

The server sets its user interaction preferences by using the AESetInteractionAllowed function. This function specifies the conditions under which your application is willing to interact with the user.

myErr := AESetInteractionAllowed(level);
The level parameter is of type AEInteractAllowed.

TYPE  AEInteractAllowed = (kAEInteractWithSelf, 
                           kAEInteractWithLocal, 
                           kAEInteractWithAll);
You can specify one of these values for the interaction level:
FlagDescription
kAEInteractWithSelfYour server application can interact with the user in response to an Apple event only when your application is also the client application--that is, only when your application is sending the Apple event to itself.
kAEInteractWithLocalYour server application can interact with the user in response to an Apple event only if the client application is on the same computer as your application. This is the default if the server application does not call the function AESetInteractionAllowed.
kAEInteractWithAllYour server application can interact with the user in response to an Apple event sent by any client application on any computer.

If the server application does not set the user interaction level, AEInteractWithUser uses kAEInteractWithLocal as the value.

If the application sends itself an Apple event (that is, if the application is both the client and the server) without setting the kAENeverInteract flag, AEInteractWithUser always allows user interaction. If the client application is a process on the local computer and specifies kAECanInteract or kAEAlwaysInteract, and if the server has set the interaction level to kAEInteractWithLocal or kAEInteractWithAll, then AEInteractWithUser allows user interaction. If the client is a process on a remote computer on the network and specifies kAECanInteract or kAEAlwaysInteract, AEInteractWithUser allows user interaction only if the server specified the kAEInteractWithAll flag for the interaction level. In all other cases, AEInteractWithUser does not allow user interaction.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996