Version: 1.0

Posted: 2003-01-30

Build Requirements: N/A

Runtime Requirements: Carbon

View Source Code:

Download Sample (“”, 86.8K)
Download Sample (“Fragment_Tool.dmg”, 151.7K)


"Fragment Tool" is a simple application designed to allow basic manipulation of code fragments. It allows you to combine or separate several code fragments, and view and edit various pieces of information associated with each code fragment. It demonstrates several Toolbox Managers and several common, and some not so common, features of these Managers: * Code Fragment Manager -Loading and preparing a code fragment from the data fork of a file. -Retrieving a list of exported symbols from a prepared code fragment. -Interpreting and manipulating the 'cfrg' resource. * Drag Manager -Creating an application specific file when content is dragged to the Finder. -Using drag data which makes sense only to your own application. -Dragable lists. * List Manager -Both 68K and PowerPC native click loop procedures (there's a gotcha with a native click loop procedure). -Non standard text styles in lists. -Dragable lists. (Okay, I've mentioned that already, but I couldn't decide what heading it under.) -Using lists in document windows. * Resource Manager -Opening resource forks without loading all preloaded resources. This is particularly important when opening application resource forks that may contain preloaded 'CODE' resources. * Dialog Manager -Non standard text styles in a dialog, including popup menus and editable text items. -Support a number of moveable modal dialogs in an application. It also demonstrates: -How to properly support the standard event loop, including basic support for multiple monitors. -How to safely check if a system feature is available in a native PowerPC application (Gestalt isn't always enough). -A stream 'class' that allows you to stream data elements into a memory block, and then retrieve the elements later. -An example of using function pointers for your own purposes. -How to get access to the Temporary Items Folder and use it to keep temporary files. This is not intended to be a definitive 'document' on how to implement these features, but illustrates one approach you can take. Keywords: CFM, Code Fragment Manager

Document Revision History

Date Notes
2003-01-30Demonstrates manipulation of code fragments; combining and separating; viewing and editing information associated with each.

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.