More go fmt.
This commit is contained in:
parent
380afbf755
commit
a210775287
10
area_unix.go
10
area_unix.go
|
@ -6,8 +6,8 @@ package ui
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"unsafe"
|
|
||||||
"image"
|
"image"
|
||||||
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
// #include "gtk_unix.h"
|
// #include "gtk_unix.h"
|
||||||
|
@ -33,7 +33,7 @@ func gtkAreaNew() *C.GtkWidget {
|
||||||
// the Area's size will be set later
|
// the Area's size will be set later
|
||||||
// we need to explicitly subscribe to mouse events with GtkDrawingArea
|
// we need to explicitly subscribe to mouse events with GtkDrawingArea
|
||||||
C.gtk_widget_add_events(drawingarea,
|
C.gtk_widget_add_events(drawingarea,
|
||||||
C.GDK_BUTTON_PRESS_MASK | C.GDK_BUTTON_RELEASE_MASK | C.GDK_POINTER_MOTION_MASK | C.GDK_BUTTON_MOTION_MASK | C.GDK_ENTER_NOTIFY_MASK | C.GDK_LEAVE_NOTIFY_MASK)
|
C.GDK_BUTTON_PRESS_MASK|C.GDK_BUTTON_RELEASE_MASK|C.GDK_POINTER_MOTION_MASK|C.GDK_BUTTON_MOTION_MASK|C.GDK_ENTER_NOTIFY_MASK|C.GDK_LEAVE_NOTIFY_MASK)
|
||||||
// and we need to allow focusing on a GtkDrawingArea to enable keyboard events
|
// and we need to allow focusing on a GtkDrawingArea to enable keyboard events
|
||||||
C.gtk_widget_set_can_focus(drawingarea, C.TRUE)
|
C.gtk_widget_set_can_focus(drawingarea, C.TRUE)
|
||||||
scrollarea := C.gtk_scrolled_window_new((*C.GtkAdjustment)(nil), (*C.GtkAdjustment)(nil))
|
scrollarea := C.gtk_scrolled_window_new((*C.GtkAdjustment)(nil), (*C.GtkAdjustment)(nil))
|
||||||
|
@ -128,13 +128,13 @@ func finishMouseEvent(widget *C.GtkWidget, data C.gpointer, me MouseEvent, mb ui
|
||||||
state = translateModifiers(state, gdkwindow)
|
state = translateModifiers(state, gdkwindow)
|
||||||
me.Modifiers = makeModifiers(state)
|
me.Modifiers = makeModifiers(state)
|
||||||
// the mb != # checks exclude the Up/Down button from Held
|
// the mb != # checks exclude the Up/Down button from Held
|
||||||
if mb != 1 && (state & C.GDK_BUTTON1_MASK) != 0 {
|
if mb != 1 && (state&C.GDK_BUTTON1_MASK) != 0 {
|
||||||
me.Held = append(me.Held, 1)
|
me.Held = append(me.Held, 1)
|
||||||
}
|
}
|
||||||
if mb != 2 && (state & C.GDK_BUTTON2_MASK) != 0 {
|
if mb != 2 && (state&C.GDK_BUTTON2_MASK) != 0 {
|
||||||
me.Held = append(me.Held, 2)
|
me.Held = append(me.Held, 2)
|
||||||
}
|
}
|
||||||
if mb != 3 && (state & C.GDK_BUTTON3_MASK) != 0 {
|
if mb != 3 && (state&C.GDK_BUTTON3_MASK) != 0 {
|
||||||
me.Held = append(me.Held, 3)
|
me.Held = append(me.Held, 3)
|
||||||
}
|
}
|
||||||
// don't check GDK_BUTTON4_MASK or GDK_BUTTON5_MASK because those are for the scrolling buttons mentioned above; there doesn't seem to be a way to detect higher buttons... (TODO)
|
// don't check GDK_BUTTON4_MASK or GDK_BUTTON5_MASK because those are for the scrolling buttons mentioned above; there doesn't seem to be a way to detect higher buttons... (TODO)
|
||||||
|
|
Loading…
Reference in New Issue