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


search for in the  


previousGtkTreeStore::remove
GtkTreeStore::swapnext

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

GtkTreeStore::set

void set(GtkTreeIter iter, column, value [, column [, value]]);

Sets the values of the row specified by iter. The parameters have to be pairs, determining the column id and the value the column shall be set to.

This method is useful when you used insert() or one of its siblings to create an empty row, or if you want to change multiple columns of a row.

Example 137. Setting column values with set()

<?php
//A row in that store can hold a string, an integer and a float
$store = new GtkTreeStore(Gtk::TYPE_STRING, Gtk::TYPE_LONG, GTK::TYPE_DOUBLE);
 
//create a new (empty) row
$row = $store->insert();
//set value of the first row
$store->set($row, 0, 'String');
//set value of the third and second row
$store->set($row, 2, 0.5, 1, 20);
 
 
//Display the store
$wnd  = new GtkWindow();
$view = new GtkTreeView($store);
$rend = new GtkCellRendererText();
$view->append_column(new GtkTreeViewColumn('String', $rend, 'text', 0));
$view->append_column(new GtkTreeViewColumn('Int'   , $rend, 'text', 1));
$view->append_column(new GtkTreeViewColumn('Float' , $rend, 'text', 2));
$wnd->add($view);
$wnd->connect_simple('destroy', array('gtk', 'main_quit'));
$wnd->show_all();
Gtk::main();
 
?>

See also: append() , prepend()


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


previousGtkTreeStore::remove
GtkTreeStore::swapnext

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:56 2009 UTC