Creating Gray Extras Drawer Icons
Gray icons are created as a pair of normal and a highlighted icons. Each of these icons is a pix family. Gray icons are stored in a part frame'siconPro
slot. To remain compatible with previous system versions, the part must also contain anicon
slot with black and white data.Note that icons in the button bar are clipped if they are too large. Also, since the button bar is gray, you must include a mask with your icon, The mask should be lightly larger than the icon. The size of the mask must be no larger than 29x32, and the size of the regular icon must be less than 27x30. For more information on how to create icons, see Chapter 5, "Icons," in Newton 2.0 User Interface Guidelines.
Icons for form parts (application parts) can be created with NTK's application icon editor. For information on this editor, see "Application Icon Editor". For other kind of parts (auto parts, store parts, etc.) you must create them programmatically with the *
- Note
- The size of all PICTs in a pix family must be identical. That is, they must be selected with the same size selection rectangle. An icon's mask should larger in the sense of having a larger image, that is the mask should heave more on bits than the icon has non-white pixels.
![]()
MakeExtrasIcons
function, and add them to your part frame with theSetPartFrameSlot
function. The code example in Listing 6-1 shows how to assign an icon to a part programmatically.Listing 6-1 Code to add an
icon
andiconPro
slot to a part frame
// example giving an icon to a non-form part - works for 2.0 and // later devices (NTK's Project Setting handles this for form parts)
OpenResFile(HOME & "foo.rsrc"); extrasIcons := MakeExtrasIcons([ {unhilitedRsrcSpec: "foo.bw", //b&w normal icon hilitedRsrcSpec: "foo.bw.hilited", //b&w hilited icon bitDepth: 1}, {unhilitedRsrcSpec: "foo.gray",//gray normal icon hilitedRsrcSpec: "foo.gray.hilited", //gray hilited icon bitDepth: 4}, ], "foo.mask", //mask for normal icons "foo.hilited.mask" //mask for hilited icons ); SetPartFrameSlot('iconPro, extrasIcons.iconPro); SetPartFrameSlot('icon, extrasIcons.icon); SetPartFrameSlot('text, "foo"); // must have a text slot or the part //is ignored by the Extras Drawer CloseResFile();
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help