Important: The information in this document is obsolete and should not be used for new development.
NewSubscriberDialog
When a user chooses the Subscribe To menu command, your application should call theNewSubscriberDialogfunction 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
containerfield of this record. You also specify in theformatsMaskfield which edition format typesNewSubscriberDialogshould display. TheNewSubscriberDialogfunction returns information concerning the user's choice in thecanceledandcontainerfields 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
NewSubscriberDialogfunction returns in this field a value that indicates whether the user canceled the dialog box. The function returnsTRUEin thecanceledfield if the user canceled the dialog box. Otherwise, the function returnsFALSEin this field and returns in thecontainerfield the edition container for the new subscriber.formatsMask- The
formatsMaskfield indicates which edition format type (text, graphics, and sound) to display within the subscriber dialog box. You can set theformatsMaskfield to the following constants:kTEXTformatMask(1),kPICTformatMask(2), orksndFormatMask(4). To support a combination of formats, add the constants together. For example, aformatsMaskof 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,
NewSubscriberDialogreturnsFALSEin thecanceledfield and returns the selected edition container for the new subscriber in thecontainerfield.DESCRIPTION
TheNewSubscriberDialogfunction displays the subscriber dialog box on the user's screen. TheNewSubscriberDialogfunction (which is based on theCustomGetFileprocedure 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 thecontainerfield of thereplyparameter. Use theGetLastEditionContainerUsedfunction to get the edition container of the last edition that was either published or subscribed to, then set thecontainerfield 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, theNewSubscriberDialogfunction 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 theeoCanSubscribeverb).RESULT CODES
noErr 0 No error editionMgrInitErr -450 Manager not initialized or could not load package badSubPartErr -454 Bad 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 ofNewSubscriberDialog, 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.