Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

MouseEvent() on G4P GLabel

$
0
0

Hello I have a question about the event handler associated with the GLabel of my code. I am able to add an event in my setup, but it never gets triggered when I call it later on in my code. It works fine as a GButton, but does anyone know if it is possible to add an event to a GLabel. I included sample code to show what I mean.

GLabel sentencez;

...

sentencez = new GLabel(this, 0, height-90, width/2, 100, ""); sentencez.setVisible(true); sentencez.addEventHandler(this, "sentenceButtonEvent");

...

void sentenceButtonEvent(GLabel s, GEvent event){ if(s == sentencez){ Xplosion.play();

} }


Viewing all articles
Browse latest Browse all 2896

Trending Articles