problems with button_press_event

From: Date: Wed, 26 Feb 2003 09:17:14 +0000
Subject: problems with button_press_event
Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-3064@lists.php.net to get a copy of this message
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 --------------------------------------------------------------------

« previous php.gtk.general (#3064) next »