object connect to class own function
| From: | Adrian Immler | Date: | Mon, 04 Mar 2002 17:05:49 +0000 |
| Subject: | object connect to class own function | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-1419@lists.php.net to get a copy of this message | ||
hi !
i have a class that constructs a window with some buttons, a clist and so on
...
in this class i have also 2 buttons that should be connected to functions in
the same class ...
example:
class test {
#<snip>
var $db_use_button;
var $db_refresh_button;
#<snip>
function test(){ #constructor
#<snip>
$this->db_use_button = &new GtkButton('Use Database');
$this->db_refresh_button = &new GtkButton('Refresh List');
$this->db_use_button ->connect('clicked', 'db_use()');
$this->db_refresh_button ->connect('clicked', '$this->db_refresh');
#<snip>
}
function db_refresh ($emitter){
#<snip>
}
}
the class also contains a function called db_use() but either the db_use()
nor the db_refresh() function is called when the button is clicked. instead
i get the error message:
Warning: Unable to call signal callback '$this->db_refresh' specified in
<file> on <line>
what am i doing wrong ? how has the ->connect have to look like ?