Announcements & Public Addresses


My package brings up a confirmation dialog with PerformWithConfirmationFancy(). ConfirmationDialog_Confirm will call my operation when the user accepts. Is there a way to get a method called if the user declines the confirmation


Unfortunately, there's no equivalently straightforward way to perform an operation if the user taps the no button. However, ConfirmationDialog_Hide resets the some of the fields in the ConfirmationDialog to nilObject in an effort to save memory by unshadowing objects. What you can do is set up an Observe/Notify mechanism to watch when the target field of the ConfirmationDialog is set back to nilObject. Your Notice method will get called whenever a field of the ConfirmationDialog changes, so you will definitely get called several times, both when the dialog is about to appear, and when it's about to go away. You can just ignore the other times your Notice method is called.

A second possibility is to change the target and operation number of the no button, so that an operation of your package will get called first. If you choose to do this, be sure to call ConfirmationDialog_Hide to "inherit" the standard behavior that occurs when the no button is pressed.


I would like to put up a window that explains that a problem occurred. Is there an existing window available through an indexical that I can use? The indexical iSystemWarnings, which contains a PublicAddress object, should be fine. You'll need to create an Announcement object to refer to this indexical. Here is a sample Announcement from the system to show how to set up an Announcement object:

Instance Announcement 200;
   flags: 0x0000008B; // isError, noStamp, urgent, displayOnce
   info: (Text 209);
   stamp: nilObject;
   sound: nilObject;
   publicAddress: iSystemWarnings;
End Instance;

Instance Text 209;
   info: 'The remote commander won't work until beaming is finished.';
End Instance;

You can call Announce(), passing in your Announcement object, when you need to notify them something's wrong. You might want to put iErrorSound in the sound field. You can provide a custom image that shows up in the carousel in the name bar when your announcement is presented by referring to a Stamp object in the stamp field and clearing the noStamp flag.

There's more detailed information in the Announcement and PublicAddress chapters of the Magic Cap Class and Method Reference.


When there are multiple pending announcements, the name in the announcements window is the name of the announcement stamp for the announcement. Is this correct or am I not setting certain fields? I thought that names were only a compile time thing...


The name next to the stamp in the carousel is the name you give the AnnouncementStamp object in your Objects.Def file. If you don't have an AnnouncementStamp, one will be created for you. The name of the announcement will be used to name the stamp.

Object names are not just "a compile time thing". While the system does not refer to objects by name, it does use an object's name for display purposes in many instances.

The AnnouncementStamp class is described in the Announcements chapter of the Magic Cap Class and Method Reference.


What is the difference between the info and infoFields fields of PublicAddress, and what do they do?


The info and infoFields are inherited from the InfoTopic and InfoWindow classes respectively. They're used to display the help information when the user taps the (?) in the title bar of the public address. The info field contains the current help information that is displayed when the user taps the (?). This can be a Text object, or a view chain. The infoFields describes the view chain of the InfoWindow. If the info window will display only text, the infoFields should be TextFields describing the layout of the text to be displayed. One TextField will be used for each line of text in the info object. If the info object is a chain of viewables, the infoFields will be replaced with the new view chain.

For more information, refer to the chapters about InfoWindow and PublicAddress in the Magic Cap Class and Method Reference.