PHP-GTK
Sunday, November 08, 2009 
download | documentation | applications | faq | changelog | resources 


search for in the  


previousGtkListStore::set
GtkMenunext

Last updated: Sun, 08 Nov 2009
view this page in English

GtkListStore::swap

Swaps rows a and b in the list store. Note that this function only works with unsorted stores.

Example 98. Swapping two rows

<?php
$store = new GtkListStore(Gtk::TYPE_STRING, Gtk::TYPE_LONG);
 
//insert the rows at different positions
$tokio  = $store->insert(0, array('Tokio', 34100000));
$mexico = $store->insert(1, array('Mexico city', 22650000));
 
//we swap so that mexico is first
$store->swap($tokio, $mexico);
 
//show the list
function echoRow($store, $path, $iter) {
    echo $store->get_value($iter, 0) . "\r\n";
}
$store->foreach('echoRow');
?>

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


previousGtkListStore::set
GtkMenunext

Last updated: Sun, 08 Nov 2009
view this page in English


credits 

PHP  Copyright © 2001-2009 The PHP Group
 All rights reserved.
Last updated: Sun Nov 8 02:43:46 2009 UTC