Re: Using alternate constructors

From: Date: Sun, 18 Dec 2005 11:00:32 +0000
Subject: Re: Using alternate constructors
References: 1 2 3  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-6426@lists.php.net to get a copy of this message
Hi Anant, > $toolbutton = new GtkToolButton::new_from_stock(Gtk::STOCK_OK) > isn't working. It spits: > Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE > or '$' in .... line watever. That's constructor problem: Normal constructors are called via > $widget = new Class($parameter); while "extra" constructors as new_from_stock are actually static methods: > $widget = Class::static_constructor_function($parameter) - you have to leave out the "new" as the function itself does that in a way. > The Dev-inspector is a very nifty and helpful tool, should help a > great deal in doccing :-) Jp is writing a script which tries to sync the actual php-gtk2 implementation via reflection with the docs - that will give a nifty testing facility where we can see which parameters are wrong, have changed or what methods are missing. > Great work! So it determines all the classes and its methods from the > locally installed version of PHP-Gtk2 right? Yes. The thing is called reflection - the php manual has a whole chapter about it. -- Regards/MfG, Christian Weiske

Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
« previous php.gtk.general (#6426) next »