Re: GtkTreeView and GtkTreeStore problem RESOLVED
| From: | Michael Crowl | Date: | Sat, 06 May 2006 19:57:13 +0000 |
| Subject: | Re: GtkTreeView and GtkTreeStore problem RESOLVED | ||
| References: | 1 2 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-6908@lists.php.net to get a copy of this message | ||
This was resolved. The last argument in the GtkTreeViewColumn
constructor maps to the columns incrementally but I had set them all to
zero.
I had based this code on an existing single-column example and was not
aware of what the last two arguments to the GtkTreeViewColumn
constructor. Neither the current documentation nor Dev Inspector showed
the correct constructor args. (Not complaining - I love Christian's
work here.) Someone on the Gnope forums pointed it out.
This has been... The More You Know.
-- mike
Michael Crowl wrote:
>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?
>
>
>
--
| Michael Crowl
| Web Developer
| octopus@serv.net