PHP-GTK
Friday, September 05, 2008 
download | documentation | applications | faq | changelog | resources 


search for in the  


previousGtkTreeModel
GtkTreeModel::get_column_typenext

Last updated: Sat, 15 Dec 2007
view this page in English | Bulgarian | Japanese | Brazilian | Simplified Chinese

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 124. Looping through all rows with foreach

<?php
$store = new GtkListStore(Gtk::TYPE_STRING, Gtk::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: Sat, 15 Dec 2007
view this page in English | Bulgarian | Japanese | Brazilian | Simplified Chinese


credits 

PHP  Copyright © 2001-2008 The PHP Group
 All rights reserved.
Last updated: Sat Dec 15 02:46:32 2007 UTC