GtkTreeView and GtkTreeStore problem
| From: | Michael Crowl | Date: | Sat, 06 May 2006 02:26:26 +0000 |
| Subject: | GtkTreeView and GtkTreeStore problem | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-6907@lists.php.net to get a copy of this message | ||
I've combed through the docs and can't figure this out:
// get GTKTreeView listClientProjects through GladeXML first
// test fill store
$cpStore = new GtkTreeStore(Gtk::TYPE_STRING, Gtk::TYPE_STRING);
$cpStore->append(NULL,array('Test1','1'));
$cpStore->append(NULL,array('Test2','2'));
$cpStore->append(NULL,array('Test3','3'));
// add columns
$this->listClientProjects->append_column(new
GtkTreeViewColumn('Column1', new GtkCellRendererText(), 'text', 0));
$this->listClientProjects->append_column(new
GtkTreeViewColumn('Column2', new GtkCellRendererText(), 'text', 0));
$this->listClientProjects->set_model($cpStore);
Unfortunately, I can only get this to work if I have ONE column. Once I
go to two or three columns, the FIRST item in the array is repeated for
each column. This happens even if the second column and items are set to
other types, or if their order is reversed. And I do have the latest
phpgtk2 dll...
Halp?