# update_in_place

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/tui/widgets/_static_update/update_in_place)

Update a `Static`, and relayout only when the content width changes.

`Static.update` relayouts the whole screen by default. That reflows every
mounted transcript widget, so a 10 Hz spinner gets slower as the
transcript grows. A spinner tick swaps one glyph at the same cell width,
so a repaint is sufficient. A width change (for example, the elapsed time
grows from `(59s)` to `(1m 0s)`) still relayouts, so `width: auto`
widgets resize and wrapped lines reflow.

## Signature

```python
update_in_place(
    widget: Static,
    content: str | Content,
) -> None
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `widget` | `Static` | Yes | Widget to update. |
| `content` | `str \| Content` | Yes | New content. Plain strings are compared as unstyled text. |

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/1425cf0b7c5e88bff8735778af82cf5c90564085/libs/code/deepagents_code/tui/widgets/_static_update.py#L13)