The most basic way of connecting a signal to a callback is by using connect() method. All classes descended from GtkObject have it. For example, to respond to a 'clicked' signal on a GtkButton widget, you would do this:

<?php
  
function on_ok_clicked($button) {  }
  
$ok_button->connect('clicked''on_ok_clicked');
?>
If you wanted to connect to a class method or an object method, you have to use a special syntax for denoting that:

<?php
  
class {
    function 
on_ok_clicked($button) { }
  }
  
$ok_button->connect('clicked', array('A''on_ok_clicked')); // connect to a class method

  
$a_obj = new A();
  
$ok_button->connect('clicked', array(&$a_obj'on_ok_clicked')); // connect to an instance method
?>