<!--
{
  "documentType" : "article",
  "framework" : "quicktime-file-format",
  "identifier" : "/documentation/QuickTime-File-Format/Modifying_atoms",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "Modifying atoms"
}
-->

# Modifying atoms

Modify attributes or data associated with an atom in an atom container.

## Overview

`TextQuickTime` provides functions that you can call to modify attributes or data associated with an atom in an atom container. To modify an atom’s ID, you call the function `QTSetAtomID`.

You use the `QTSetAtomData` function to update the data associated with a leaf atom in an atom container. The `QTSetAtomData` function replaces a leaf atom’s data with new data. The code sample in the following listing calls `QTFindChildByIndex` to determine whether an atom container contains a sprite’s visible property. If so, the sample calls `QTSetAtomData` to replace the atom’s data with a new visible property.

```c
QTAtom propertyAtom;
 
// if the atom isn’t in the container, add it
if ((propertyAtom = QTFindChildByIndex (sprite, kParentAtomIsContainer,
    kSpritePropertyVisible, 1, nil)) == 0)
    FailOSErr (QTInsertChild (sprite, kParentAtomIsContainer,
        kSpritePropertyVisible, 1, 0, sizeof(short), visible, nil))
 
// if the atom is in the container, replace its data
else
    FailOSErr (QTSetAtomData (sprite, propertyAtom, sizeof(short),
        visible));
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)