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 theNewSubscriberDialog
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 theformatsMask
field which edition format typesNewSubscriberDialog
should display. TheNewSubscriberDialog
function returns information concerning the user's choice in thecanceled
andcontainer
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 returnsTRUE
in thecanceled
field if the user canceled the dialog box. Otherwise, the function returnsFALSE
in this field and returns in thecontainer
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 theformatsMask
field to the following constants:kTEXTformatMask
(1),kPICTformatMask
(2), orksndFormatMask
(4). To support a combination of formats, add the constants together. For example, aformatsMask
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
returnsFALSE
in thecanceled
field and returns the selected edition container for the new subscriber in thecontainer
field.DESCRIPTION
TheNewSubscriberDialog
function displays the subscriber dialog box on the user's screen. TheNewSubscriberDialog
function (which is based on theCustomGetFile
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 thecontainer
field of thereply
parameter. Use theGetLastEditionContainerUsed
function to get the edition container of the last edition that was either published or subscribed to, then set thecontainer
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, theNewSubscriberDialog
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 theeoCanSubscribe
verb).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.