Re: problems with button_press_event
| From: | Volker H. Erbel | Date: | Wed, 26 Feb 2003 09:42:09 +0000 |
| Subject: | Re: problems with button_press_event | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-3066@lists.php.net to get a copy of this message | ||
Hello Betrand,
there is a workaround for this problem, I mean, I had the same problem with checking a buttons label or so and it always returned the last action before it was ready for the actual action. I think you'll find stuff about this in the online documentation.
Have a nice day,
Volker
bertrand de Baenst schrieb:
Hi,
I have some problems I do not understand with the button_press_event.
I have registered the button_press_event on a couple of buttons :
-> $tableau[$i][$j]["boutton"]->connect('button_press_event','onclick', $tableau, $taille_tableau, $i, $j);
the function onclick just checks wich button has been clicked :
-> function onclick(&$button, &$event, &$tableau, &$taille_tableau, $x, $y){
switch($event->button){
case 1:
hello2($button, $tableau, $taille_tableau, $x, $y);
// $button->signal_handlers_destroy();
break;
case 2:
break;
case 3:
// place_flag($button, $taille_tableau, $x, $y);
break;
}
return true;
}
The problem is the following.
Whenever I click on a button with the left mouse button, it calls the function hello2(...), no problems.
but then whenever I click on something else (anything from another button or even the menu bar) it just redoes the hello2(...) function all over again for the button I pressed before.
One more thing, The function hello2(...) is a recursive function which hides, or changes the text in the button just clicked, and the buttons besides him depending on certain informations.
Does the set_text(...), or hide(...) functions throw a button_press_event ???
otherwise I'm completly lost. :-(
Have a good day
Bertrand.
--------------------------------------------------------------------
Ici git un dieu foudroyé.
Sa chute fut formidable.
Nous n'avons fait que construire son piedestral.
il etait etroit et tres haut.
epigrame Tleilaxu
--------------------------------------------------------------------
--
Mit freundlichen Grüssen
Volker H. Erbel
Entwickler
Kundenberater
__________________________
>>)))))°<
submedia, new media services
Seyfferstraße 59
70197 Stuttgart
Tel.: 0711 / 5000 930
Fax: 0711 / 5000 932
http:// www.submedia.de