PHP-GTK
Sunday, September 21, 2014 
download | documentation | applications | faq | changelog | resources 


search for in the  


previousGtkTreeModel
GtkTreeModel::get_column_typenext

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

GtkTreeModel::foreach

Calls the given callback function for each single row in the store.

The callback function can have the following parameters: (GtkTreeModel model, GtkTreePath path, GtkTreeIter iter).

Example 127. Looping through all rows with foreach

<?php
$store = new GtkListStore(Gobject::TYPE_STRING, Gobject::TYPE_LONG);
 
$store->append(array('Tokio', 34100000));
$store->append(array('Mexico city', 22650000));
$store->append(array('New York', 21850000));
$store->append(array('São Paulo', 20200000));
 
/*
* And now show what we've got in the store
*/
function echoRow($store, $path, $iter)
{
    $city   = $store->get_value($iter, 0);
    $number = $store->get_value($iter, 1);
    echo $city . ' has ' . $number . " inhabitants.\r\n";
}
$store->foreach('echoRow');
?>

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


previousGtkTreeModel
GtkTreeModel::get_column_typenext

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:00 2013 CEST