Widgets and ChildAnchors
| Chapter 14. TextView |

## Widgets and ChildAnchors

You can embed widgets, such as `Gtk::Button`s, in the text. Each such child widget needs a `ChildAnchor`. ChildAnchors are associated with `iterator`s. For instance, to create a child anchor at a particular position, use `Gtk::TextBuffer::create_child_anchor()`:

    auto refAnchor = refBuffer->create_child_anchor(iter);

Then, to add a widget at that position, use `Gtk::TextView::add_child_at_anchor()`:

    m_TextView.add_child_at_anchor(m_Button, refAnchor);

Reference

Chapter 14. TextView |  | Examples