Re: [PHP-GTK] error in constructor
[email protected] (Jake) Mon, 31 Aug 2009 13:58:21 -0400
| Newsgroups | php.gtk.general |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Aug 31, 2009 at 1:32 PM, Benjamin FOURTICQ < [email protected]> wrote: > I imagine the constructor is called twice, because when you call $toto = > new ProjectList() > ProjectList::__construct() is called and so GtkTreeview::__construct(), > then ProjectList::ProjectList() because it exists. > > That is not correct, if there's a ProjectList::__construct() method that will be called as the constructor and not ProjectList::ProjectList(). ProjectList::ProjectList() only gets called if there is no ProjectList::__construct() for backwards compatibility. > > Le 31/08/2009 19:07, Der Starchaser a écrit : > > >> I want to program a class ProjectList, which is derived from class >> GtkTreeView. The following code snippet results in an assertion error. Is >> anybody able to explain me the error ? >> > > Your assertion fails because there are no columns in the view. See: http://gtk.php.net/manual/en/gtk.gtktreeview.php Specifically: "After creating the view and setting the model, you need to create some GtkTreeViewColumns and add them to the view with append_column() . The column widgets themselves need some GtkCellRenderers that actually draw and display the data of the model." -Jake