public static interface Widget.ButtonPressEvent
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.
Modifier and Type | Method and Description |
---|---|
boolean |
onButtonPressEvent(Widget source,
EventButton event) |
boolean onButtonPressEvent(Widget source, EventButton event)