Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Interapplication Communication /
Chapter 2 - Edition Manager / Edition Manager Reference
Edition Manager Routines / Displaying Dialog Boxes


NewSubscriberDialog

When a user chooses the Subscribe To menu command, your application should call the NewSubscriberDialog function to allow the user to choose an edition to subscribe to.

FUNCTION NewSubscriberDialog 
                     (VAR reply: NewSubscriberReply): OSErr;
reply
The new subscriber reply record. You specify a location to use as the default edition container in the container field of this record. You also specify in the formatsMask field which edition format types NewSubscriberDialog should display. The NewSubscriberDialog function returns information concerning the user's choice in the canceled and container fields of this record.
TYPE NewSubscriberReply = 
   RECORD
      canceled:      Boolean;             {user canceled }
                                          { dialog box}
      formatsMask:   SignedByte;          {formats required}
      container:     EditionContainerSpec;{edition selected}
   END;
Field Description
canceled
The NewSubscriberDialog function returns in this field a value that indicates whether the user canceled the dialog box. The function returns TRUE in the canceled field if the user canceled the dialog box. Otherwise, the function returns FALSE in this field and returns in the container field the edition container for the new subscriber.
formatsMask
The formatsMask field indicates which edition format type (text, graphics, and sound) to display within the subscriber dialog box. You can set the formatsMask field to the following constants: kTEXTformatMask (1), kPICTformatMask (2), or ksndFormatMask (4). To support a combination of formats, add the constants together. For example, a formatsMask of 3 displays both graphics and text edition format types in the subscriber dialog box.
container
The edition container of the last edition published or subscribed to. You provide in this parameter the location and filename to use as the default edition to subscribe to. If the user clicks the Subscribe button, NewSubscriberDialog returns FALSE in the canceled field and returns the selected edition container for the new subscriber in the container field.
DESCRIPTION
The NewSubscriberDialog function displays the subscriber dialog box on the user's screen. The NewSubscriberDialog function (which is based on the CustomGetFile procedure described in the chapter "Standard File Package" in Inside Macintosh: Files) switches to the volume reference number and directory ID and selects the filename of the edition container that you specified in the container field of the reply parameter. Use the GetLastEditionContainerUsed function to get the edition container of the last edition that was either published or subscribed to, then set the container field to this edition container. This allows the user to publish and then easily subscribe.

Note that if an edition does not contain either 'PICT', 'TEXT', or 'snd ' data, the NewSubscriberDialog function does not list the edition file in the new subscriber dialog box (unless you install an opener that can recognize the edition's data in response to the eoCanSubscribe verb).

RESULT CODES
noErr0No error
editionMgrInitErr-450Manager not initialized or could not load package
badSubPartErr-454Bad edition container spec
SEE ALSO
For an illustration of the new subscriber dialog box, see Figure 2-12 on page 2-37. For an example of the use of NewSubscriberDialog, see Listing 2-6 beginning on page 2-40. For a description of the edition container record, see page 2-71. For information on edition openers, see "Subscribing to Non-Edition Files" beginning on page 2-62.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996