GtkListStore::move_before
Moves the given iter just before position. If position is null, the row will be moved at the end of the list.
参照: move_after() , insert_before()
例 91. Moving a row before another one
<?php
$store = new GtkListStore(Gtk::TYPE_STRING, Gtk::TYPE_LONG);
$tokio = $store->insert(0, array('Tokio', 34100000));
$mexico = $store->insert(1, array('Mexico city', 22650000));
$seoul = $store->insert(2, array('Seoul', 22250000));
//move Seoul before Mexico
$store->move_before($seoul, $mexico);
//show the list
function echoRow($store, $path, $iter) {
echo $store->get_value($iter, 0) . "\r\n";
}
$store->foreach('echoRow');
?> |