Segfault on toggle callback with GtkCheckButton

From: Date: Fri, 08 Feb 2008 00:05:30 +0000
Subject: Segfault on toggle callback with GtkCheckButton
Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-8165@lists.php.net to get a copy of this message
Hi All, I'm new to PHP-GTK, but I've got a fairly strong background using gtk and C. I've been attempting to set up a callback function that is called whenever a GtkCheckButton is toggled, but I'm getting a segfault every time. I've reproduced the crash in the below code. This is running on Ubuntu 7.10/Gutsy using the Ubuntu 5.2.3 php5-cli executable. Any ideas? xdebug isn't giving me any stacktrace on the segfault, so I assume that means the php executable itself is crashing. Thanks, -- Alex Augot /////////////////////////// Code /////////////////////////// <?php // Toggle Button Crash Test class testClass { private $gtkButton; public function createButton() { $this->gtkButton = new GtkCheckButton("My Label"); $this->gtkButton->connect_simple('toggled', array($this, 'selectedEvent')); } public function getButton() { return $this->gtkButton; } public function selectedEvent() { if($this->gtkButton->get_active()) $this->gtkButton->set_active(false); else $this->gtkButton->set_active(true); } } // Create the test button $testButton = new testClass(); $testButton->createButton(); // Create a test window, hbox, and add // the button to it. When button is toggled, it segfaults $gtkWindow = new GtkWindow(); $gtkBox = new GtkHBox(); $gtkWindow->add($gtkBox); $gtkBox->add($testButton->getButton()); $gtkWindow->set_visible(true); Gtk::main(); ?>

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