PHP-GTK
Tuesday, October 21, 2014 
download | documentation | applications | faq | changelog | resources 


search for in the  


previousGtkTreeStore::insert_after
GtkTreeStore::is_ancestornext

Last updated: Sun, 12 May 2013
view this page in English

GtkTreeStore::insert_before

GtkTreeIter insert_before([GtkTreeIter sibling [, GtkTreeIter parent [, array items]]]);

Inserts a new row before sibling. If sibling is null, then the row will be appended to parent's children. If parent and sibling are null, then the row will be appended to the toplevel. If both sibling and parent are set, then parent must be the parent of sibling. When sibling is set, parent is optional.

items can be an array of values for the column.

Example 134. Filling a GtkTreeStore with insert_before

<?php
//new model with just one column of type string
$store = new GtkTreeStore(Gtk::TYPE_STRING);
 
//insert a new row without a parent (root row)
$root = $store->insert_after();
$store->set($root, 0, 'root');
 
//insert root2 before $root
$root2 = $store->insert_before($root);
$store->set($root2, 0, 'root2');
 
//insert this child as child of root row
$child1 = $store->insert_before(null, $root, array('child1'));
 
//insert this child before $child1
$child2 = $store->insert_before($child1, $root, array('child2'));
 
 
//Display the store
$wnd  = new GtkWindow();
$view = new GtkTreeView($store);
$view->append_column(
    new GtkTreeViewColumn('String column', new GtkCellRendererText(), 'text', 0)
);
$wnd->add($view);
$wnd->connect_simple('destroy', array('gtk', 'main_quit'));
$wnd->show_all();
Gtk::main();
?>

See also: insert() , insert_after() , append() , prepend()


User Contributed Notes
gtk.gtktreestore.method.insert_before.php
add a note about notes
There are no user contributed notes for this page.


previousGtkTreeStore::insert_after
GtkTreeStore::is_ancestornext

Last updated: Sun, 12 May 2013
view this page in English


credits 

PHP  Copyright © 2001-2014 The PHP Group
 All rights reserved.
Last updated: Sun May 12 20:51:01 2013 CEST