GtkObject::disconnect

void disconnect(int handler_id);

Removes the connection identified by handler_id. handler_id is the value returned from connect() or one of its sister functions. When the connection is removed, the function that was passed to connect() will not be called when the signal that was passed is emitted.

Ejemplo 30. Disconnecting a method

<?php
// Say 'hi' on the terminal 
function sayHi() 
{
    echo 'Hi';
}

// Make a button shut up.
function beQuiet(&$button, $handler)
{
    $button->disconnect($handler);
}

// Set up the window
$window =& new GtkWindow;
$hBox   =& new GtkHBox;

// Make a button that says hi.
$button1 =& new GtkButton('Say Hi');
$handler =  $button1->connect('clicked', 'sayHi');

// Make the first button shut up when the second is clicked.
$button2 =& new GtkButton('Be Quiet!');
$button2->connect_object('clicked', 'beQuiet', $button1, $handler);

$hBox->pack_start($button1);
$hBox->pack_start($button2);

$window->add($hBox);
$window->show_all();
gtk::main();
?>

See also: connect()