Re: problems with button_press_event
| From: | bertrand de Baenst | Date: | Wed, 26 Feb 2003 09:38:30 +0000 |
| Subject: | Re: problems with button_press_event | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-3065@lists.php.net to get a copy of this message | ||
I just thought about a solution.
Before I introduced the button_press_event (to enable the right button event), i used the clicked event (which worked perfectly) so now i just put the two signals callbacks on the button, and do nothing on the button_press_event -> leftclick event. and it seems to work.
I'm going to do more tests.
But if you know why it doesn't work with the button_press_event I'm still interested. (I am afraid I will have the same problem when i take into consideration the right mouse click...)
Regards,
Bertrand.
At 10:17 26/02/2003 +0100, you wrote:
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
--------------------------------------------------------------------
--
PHP-GTK General Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--------------------------------------------------------------------
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
--------------------------------------------------------------------