---
name: "Gtk2::TreeStore"
section: "3pm"
platform: "linux"
package: "libgtk2-perl-doc"
version: "2:1.24992-1"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/Gtk2::TreeStore"
---

# Gtk2::TreeStore(3pm)

wrapper for GtkTreeStore

## NAME

Gtk2::TreeStore - wrapper for GtkTreeStore

## HIERARCHY

```
  Glib::Object
  +----Gtk2::TreeStore
```

## INTERFACES

```
  Gtk2::TreeModel
  Gtk2::TreeDragSource
  Gtk2::TreeDragDest
  Gtk2::TreeSortable
  Gtk2::Buildable
```

## METHODS

### treestore = Gtk2::TreeStore-\>new (...)

- •

  ... (list) of strings, package names

### treeiter = $tree\_store-\>append ($parent)

- •

  `$parent` (Gtk2::TreeIter or undef)

### $tree\_store-\>clear

### $tree\_store-\>set\_column\_types (...)

- •

  ... (list) of strings, package names

### $tree\_store-\>set ($iter, $col1, $val1, ...)

- •

  `$iter` (Gtk2::TreeIter)

- •

  `$col1` (integer) the first column number

- •

  `$val1` (scalar) the first value

- •

  ... (list) pairs of columns and values

### treeiter = $tree\_store-\>insert ($parent, $position)

- •

  `$parent` (Gtk2::TreeIter or undef)

- •

  `$position` (integer)

### treeiter = $tree\_store-\>insert\_after ($parent, $sibling)

- •

  `$parent` (Gtk2::TreeIter or undef)

- •

  `$sibling` (Gtk2::TreeIter or undef)

### treeiter = $tree\_store-\>insert\_before ($parent, $sibling)

- •

  `$parent` (Gtk2::TreeIter or undef)

- •

  `$sibling` (Gtk2::TreeIter or undef)

### treeiter = $tree\_store-\>insert\_with\_values ($parent, $position, ...)

- •

  `$parent` (Gtk2::TreeIter or undef)

- •

  `$position` (integer) position to insert the new row

- •

  ... (list) pairs of column numbers and values

Like doing insert followed by set, except that insert\_with\_values emits only the row-inserted signal, rather than row-inserted, row-changed, and, if the store is sorted, rows-reordered as in the multiple-operation case. Since emitting the rows-reordered signal repeatedly can affect the performance of the program, insert\_with\_values should generally be preferred when inserting rows in a sorted tree store.

Since: gtk+ 2.10

### boolean = $tree\_store-\>is\_ancestor ($iter, $descendant)

- •

  `$iter` (Gtk2::TreeIter)

- •

  `$descendant` (Gtk2::TreeIter)

### integer = $tree\_store-\>iter\_depth ($iter)

- •

  `$iter` (Gtk2::TreeIter)

### boolean = $tree\_store-\>iter\_is\_valid ($iter)

- •

  `$iter` (Gtk2::TreeIter)

Since: gtk+ 2.2

### $tree\_store-\>move\_after ($iter, $position)

- •

  `$iter` (Gtk2::TreeIter)

- •

  `$position` (Gtk2::TreeIter or undef)

Since: gtk+ 2.2

### $tree\_store-\>move\_before ($iter, $position)

- •

  `$iter` (Gtk2::TreeIter)

- •

  `$position` (Gtk2::TreeIter or undef)

Since: gtk+ 2.2

### treeiter = $tree\_store-\>prepend ($parent)

- •

  `$parent` (Gtk2::TreeIter or undef)

### boolean = $tree\_store-\>remove ($iter)

- •

  `$iter` (Gtk2::TreeIter)

The return is always a boolean in the style of Gtk 2.2.x and up, even when running on Gtk 2.0.x.

### $tree\_store-\>reorder ($parent, ...)

- •

  `$parent` (Gtk2::TreeIter or undef)

- •

  ... (list) of integer's, the new\_order

Since: gtk+ 2.2

### $tree\_store-\>swap ($a, $b)

- •

  `$a` (Gtk2::TreeIter)

- •

  `$b` (Gtk2::TreeIter)

Since: gtk+ 2.2

### $tree\_store-\>set\_value ($iter, $col1, $val1, ...)

- •

  `$iter` (Gtk2::TreeIter)

- •

  `$col1` (integer) the first column number

- •

  `$val1` (scalar) the first value

- •

  ... (list) pairs of columns and values

Alias for *Gtk2::TreeStore::set()*.

## SEE ALSO

Gtk2, Glib::Object

## COPYRIGHT

Copyright (C) 2003-2011 by the gtk2-perl team.

This software is licensed under the LGPL.  See Gtk2 for a full notice.
