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


search for in the  


previousGtkListStore::clear
GtkListStore::insert_afternext

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

GtkListStore::insert

GtkTreeIter insert (int row [, array items ]);

Inserts a new row at the given position and returns the iterator for that specific row. After that, you can set the row data via set() method.

You can pass an array with the complete row data as second parameter, which automatically sets the data for you. The size of the array has to match the number of columns in the store, and the type as to be equal to the corresponding column type.

Example 96. Inserting some rows into a list store

<?php
//Create new store with two columns
$store = new GtkListStore(Gobject::TYPE_STRING, Gobject::TYPE_LONG);
 
//insert the rows at different positions
$store->insert(1, array('Tokio', 34100000));
$store->insert(0, array('Mexico city', 22650000));
 
//use the iterator to set the data after insertion
$iter = $store->insert(1);
$store->set($iter, 0, 'Seoul', 1, 22250000);
?>

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


previousGtkListStore::clear
GtkListStore::insert_afternext

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:50:59 2013 CEST