delete-event : Erases member data in class?
| From: | Beriah Dutcher | Date: | Fri, 28 Oct 2005 04:07:19 +0000 |
| Subject: | delete-event : Erases member data in class? | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-6307@lists.php.net to get a copy of this message | ||
Hi all,
Im going to try to explain this as thorough as possible without having to post too much of the code. But the just of it is I have a window class that uses another window class for error displaying and calls the error classes "show" function and passes it a callback to a function within itself.
$this->kWarningMgr->show( array( $this, "close_wdwWarning" ) );
Then in the error class the show function looks like this ...
function show( $close )
{
$this->eventClose = $close;
$this->window->signal_handler_unblock( $this->hndFocus );
$this->btnAccept->grab_focus();
$this->window->show_all();
}
Here everything is fine, if you use print_r( $this->eventClose ) it spits on the data in the array. first element an object and the second a string to the "close_wdwWarning" function in the calling window class.
When the delete-event or even the destroy event is fired.
function delete_event( $window, $event )
{
$this->window->signal_handler_block( $this->hndFocus );
$window->hide_all();
call_user_func( $this->eventClose );
return true;
}
The data in $this->eventClose is gone. However the data in $this->hndFocus echo out the id of the signal. I have tried a billion things and I can assure you that the $this->eventClose is NOT being nulled anywhere in the code. Anyone else had weirdness like this? If asked I can post the entire code for them for the two classes in question.