Gtk.TreeStore

const Gtk = imports.gi.Gtk;

let tree_store = new Gtk.TreeStore();
  

The Gtk.TreeStore object is a list model for use with a Gtk.TreeView widget. It implements the Gtk.TreeModel interface, and consequentialy, can use all of the methods available there. It also implements the Gtk.TreeSortable interface so it can be sorted by the view. Finally, it also implements the tree <link linkend="gtk3-GtkTreeView-drag-and-drop">drag and drop</link> interfaces.

<refsect2 id="GtkTreeStore-BUILDER-UI"> <title>GtkTreeStore as GtkBuildable</title> The GtkTreeStore implementation of the Gtk.Buildable interface allows to specify the model columns with a &lt;columns&gt; element that may contain multiple &lt;column&gt; elements, each specifying one model column. The "type" attribute specifies the data type for the column. <example> <title>A UI Definition fragment for a tree store</title> <programlisting><![CDATA[ <object class="GtkTreeStore"> <columns> <column type="gchararray"/> <column type="gchararray"/> <column type="gint"/> </columns> </object> ]]></programlisting> </example> </refsect2>

Hierarchy

  • GObject.Object
    • Gtk.TreeStore