RE: [PHP-GTK] PHP4 Object Issues.
| From: | Nghia | Date: | Tue, 02 Aug 2005 22:45:52 +0000 |
| Subject: | RE: [PHP-GTK] PHP4 Object Issues. | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-6126@lists.php.net to get a copy of this message | ||
Does your program have more than 1 callbacks executing when the user does
something to the Ctree?
It might be useful if you put a print out everytime your function gets
called to see what the sequence of function calls are. I had a few strange
experiences with Ctree before but not sure if its similar to yours.
-----Original Message-----
From: Piero B. Contezini [mailto:piero@grupoamerican.com.br]
Sent: Wednesday, 3 August 2005 5:18 AM
To: php-gtk-general@lists.php.net
Subject: [PHP-GTK] PHP4 Object Issues.
I know it is not a question to be placed here, but with GTK we really
use all the advanced procedures of PHP, in other places most people dont
even know its possible to do.
The problem is:
I have a object variable that stores the current selected node of a
Ctree Object, whenever a user clicks on it, the node is stored.
Somewhere in the program, I need to add a new field, and i use the node
as the parent node for the new one.
The problem i'm having is about crossing objects thru the execution
flow, and using a object variable from a function within this object,
but being called from outside. The variable in question appear to be
null, the code exemple shows my problem:
The Function atached to the select event:
function selecionar($node, $id) {
global $projeto;
$data = $this->ctree->node_get_row_data($node);
$this->node_selecionado = $node; // this is the variable i need
to store
}
The Function that uses this variable:
function add_toolbox($objeto) {
$objptr =
$this->ctree->insert_node($this->node_selecionado,null,array("N",$objeto
->nome,$tipo),0,null,null,null,null,false,false);
$this->ctree->node_set_row_data($objptr,array($this->objeto_pai,$objeto)
);
}
Here, the variable is ALWAYS null, but when i print it from other
function it is ok, anyone had this problem before?
The function add_toolbox is called always from a main object, this two
functions are from a object called toolbox, so they would be able to
share this variable.
Thanks
Piero
Obs: Maybe php has context issues with objects?
--
PHP-GTK General Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php