php-gtk and bcompiler: problems...

From: Date: Mon, 05 Mar 2007 16:28:54 +0000
Subject: php-gtk and bcompiler: problems...
Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-7725@lists.php.net to get a copy of this message
Hi All, (may be slightly off topic, but I understand that there's quite some interest in bcompiler in the php-gtk community, and also that Alan K. reads this list :)) I spent a nice sunday evening trying to get bcompiler to work, but no luck. Most of the classes I use are - as might be expected - custom extensions of Gtk widgets, like so: class myWidget extends GtkWidget { public function __construct($name) { parent::__construct(); $this->set_name($name); ... } ... } I generated bytecode as follows: include('mywidget.php'); $fh = fopen('mywidget.phb','wb'); bcompiler_write_header($fh); bcompiler_write_class($fh,'myWidget','GtkWidget'); // the third parameter here is called 'extends', according to // the documentation... bcompiler_write_footer($fh); fclose($fh); So far, so good. When I attempt to load the generated code...: include('mywidget.phb'); $foo = new myWidget('bar'); ... the script dies, complaining loudly that myWidget::set_name() is undefined. In other words, any and all methods that myWidget should have inherited from GtkWidget got lost somewhere. However, when I open the bytecode with a hex editor I can see the names of all of GtkWidget's methods, in plain text near the end of the file :) For the record, I used the win32 bcompiler dll from snaps.php.net, 5.1 branch, with everything else being Gnope 1.5... Am I doing something terribly wrong, or is this a bcompiler issue? Any pointers welcome. -- André =========================================================== Black Holes were created when God divided by zero.

« previous php.gtk.general (#7725) next »