ADC Home > Reference Library > Technical Q&As > Legacy Documents > Mac OS 9 & Earlier >

Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

Using PixPatHandle to Access the "Set Utilities Pattern" Pattern

Q How can I access the "Set Utilities Pattern" pattern? (This pattern is set by holding down the option key in the Desktop Patterns Control Panel.)

A This control panel uses resources of type 'ppat' to store this pattern. The `ppat' resource is stored in the System file in your System Folder; the desktop pattern has an ID of 16 and the utilities pattern has an ID of 42. Since this is not documented, it could be subject to change at any moment. You should be careful when using this.

A snippet of code is included here to show you how you can get to these two `ppat' resources.

 PixPatHandle ppatHandle;

      ppatHandle = (PixPatHandle) GetPixPat(42);
      if (ppatHandle != NULL) {
          SetRect(&destRect;, 15, 125, 197, 164);
          FrameRect(&destRect;);
          FillCRect(&destRect;, ppatHandle);
          DisposePixPat(ppatHandle);
      }
Note:
You can just use GetPixPat to access a `ppat' resource -- the additional code just shows how to draw with it and dispose of it when done.

Updated: 27-September-96


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.