|
java-gnome version 4.0.19 | ||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public static interface Widget.ButtonPressEvent
Signal fired when the user clicks one of their mouse buttons.
Typically, you will use this to do something specific on a mouse click,
for example popping up a context menu in response to a "right-click"
anywhere in Window w
,
w.connect(new Widget.ButtonPressEvent() { boolean onButtonPressEvent(Widget source, EventButton event) { if (event.getButton() == MouseButton.RIGHT) { // popup menu } return false; } });
Like all event signals, you only return true
if you are
intercepting this event and want to prevent the default handlers in GTK
from running.
The signal emitted when the user lets the button go is
Widget.ButtonReleaseEvent
.
Note that this signal doesn't apply just to the user clicking on a
Button Widget. Indeed, "left-click" on a Button will cause
Button.Clicked
to be emitted, and you should use that in
preference for normal purposes.
Method Summary | |
---|---|
boolean |
onButtonPressEvent(Widget source,
EventButton event)
|
Method Detail |
---|
boolean onButtonPressEvent(Widget source, EventButton event)
|
![]() java-gnome |
||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |