duplicate signals
- From: "Steph" <Steph Fox btinternet com>
- To: <gtk-list gnome org>
- Subject: duplicate signals
- Date: Wed, 1 Aug 2001 20:22:14 +0100
Does anyone have any experience of GTK signals doubling up under some conditions?
- not all signal handler functions pick up on it, & the ones that do same seem to vary ... but echoed returns from signals issued by complex widgets are doubled (ie GtkColorSelectionDialog when asked to echo selected colours) and also in the script below (PHP-GTK) the third click on the button is unblocked - and really shouldn't be - although in this instance the *echoed* returns are single once they kick in.
$i = 0;
$i = (int)$i;
function firstfunction() {
global $i, $button, $sid;
if ($i == 0) {
$button->signal_handler_block($sid);
}
$i++;
if($i == 3) {
$button->signal_handler_unblock($sid);
}
}
function myfunction() {
global $i;
echo "It wasn't blocked this time!"."\t".$i."\n";
}
$window = &new GtkWindow();
$window->set_title("testbay window");
$window->set_position(GTK_WIN_POS_CENTER);
$window->connect_object('destroy', array('gtk', 'main_quit'));
$window->show();
$button = &new GtkButton("This button will only work\nfrom the third time you click it");
$sid2 = $button->connect('clicked', 'firstfunction');
$sid = $button->connect('clicked', 'myfunction');
$window->add($button);
$button->show();
$window->show_all();
Gtk::main();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]