Late Breaking Information

In this section we tell you about things discovered too late to incorporate into the final product but which are important for you to know.

Here is the list of items of which you should be aware:

Beware that these recommendations may or may not have received a thorough validation and are not guaranteed. That's why they are in "Late Breaking." Use at your own risk.

You should occasionally check our "Late Breaking" web page to see if we have posted additional update information for MacApp & ACS Release 13.

Platinum Backgrounds

A problem was discovered in redrawing some window content under Mac OS 8 with the Platinum Appearance. When the window needs updating due to resizing, contents change, window z-order change, etc. the background color may draw using the standard white background rather than the proper Platinum Appearance color.

The fix involves replacing four files:

  1. UWindow.cp
  2. UBackgroundAdorner.h
  3. UBackgroundAdorner.cp
  4. UView.cp

These four files can be found in the "Late Breaking" folder in the MacApp Release 13 distribution.

To accomplish the basic change to the color environment, TWindow::Focus was modified to set the current grafport's background color if a content region color is available for the window. This solves 99% of the problem. When drawing in an update cycle, the windows erase to the right color, views and adorners draw in their desired colors and everything is fine... almost. Direct drawing, that is, drawing when the view wants to rather than in response to an update, was still problematic. TTEView and TEditText will illustrate this problem. The views will image correctly but then during typing will draw with a gray background even when they have a TWhiteBackgroundAdorner attached.

MacApp has a means of controllling the drawing environment even more completely: TDrawingEnvironment. This class has three methods of interest: Prepare, Setup and Complete. Prepare and Complete are designed be balanced, saving and restoring the pen and colors (or going offscreen and back if you have a custom TDrawingEnvironment for double buffering). Prepare is designed "prepare" the grafport for drawing, that is, apply the desired changes to the drawing environment just before drawing. TView::Focus was modified so that it calls the Setup method of any attached drawing environment after focusing. TWhiteBackgroundAdorner was changed to install a drawing environment in the view to which it was attached when it had a color environment identical to the one used during drawing. This way, whenever the view was focused the color environment was properly specified.

 

Quitting with Windowless Documents

Quitting an application which has windowless documents can be a problem. There is a workaround but a complete solution has not been designed yet.

The problem is that an attempt is made to use AppleEvents for dispatching the command which does the actual document closing but that the resolution of that command requires the document to have a visual representation (i.e. a window). The AppleEvent is dispatched, a search is made to find a window for the document, no such window is found, and the application object receives the event. This causes TApplication::Close to be called a second time.

None of our examples demonstrate this problem (which is why we didn't catch this sooner). It seems that this is only a problem for custom application classes which override Close and then do something unique in those Close functions.

The workaround is to add a static bool data member to your custom TApplication derivative which you set as a flag to prevent your overridden Close method from getting called twice.

 

Improper NULL Test

There is an improperly formed NULL test in the TTabbedView::GetPanelView found in the UTabbedView.cp source file.

The current code reads:

TView* TTabbedView::GetPanelView(SInt32 tabIndex)
{
  // Return the TView* of the specified tab's panel
  // view hierarchy.
  return fAGAControl
     ? NULL
     : static_cast<TView*>(fAGAControl->GetTabUserData(
                                               tabIndex));
}

It should read:

TView* TTabbedView::GetPanelView(SInt32 tabIndex)
{
  // Return the TView* of the specified tab's panel
  // view hierarchy.
  return fAGAControl.IsNULL()
     ? NULL
     : static_cast<TView*>(fAGAControl->GetTabUserData(
                                               tabIndex));
}

This function is not used anywhere within MacApp or any of the examples.


Back to the Index



© Copyright 1997 by Apple Computer, Inc. -- Last Updated 7/31/97