org.gnome.gtk

## Interface Widget.ButtonPressEvent

- Enclosing class:
    Widget

      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.

  Since:
    4.0.6
  Author:
    Andrew Cowie

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `onButtonPressEvent(Widget source, EventButton event)`

- - ### Method Detail

    - #### onButtonPressEvent

          boolean onButtonPressEvent(Widget source,
                                   EventButton event)