Пример #1
0
// Grab() is a wrapper around gdk_device_grab().
func (v *Device) Grab(w *Window, ownership GrabOwnership, owner_events bool, event_mask EventMask, cursor *Cursor, time uint32) GrabStatus {
	ret := C.gdk_device_grab(
		v.native(),
		w.native(),
		C.GdkGrabOwnership(ownership),
		gbool(owner_events),
		C.GdkEventMask(event_mask),
		cursor.native(),
		C.guint32(time),
	)
	return GrabStatus(ret)
}
Пример #2
0
#include <glib.h>
#include <stdlib.h>
*/
import "C"

var (
	// DragAction
	ACTION_DEFAULT = C.GdkDragAction(C.GDK_ACTION_DEFAULT)
	ACTION_COPY    = C.GdkDragAction(C.GDK_ACTION_COPY)
	ACTION_MOVE    = C.GdkDragAction(C.GDK_ACTION_MOVE)
	ACTION_LINK    = C.GdkDragAction(C.GDK_ACTION_LINK)
	ACTION_PRIVATE = C.GdkDragAction(C.GDK_ACTION_PRIVATE)
	ACTION_ASK     = C.GdkDragAction(C.GDK_ACTION_ASK)

	// EventMask
	EXPOSURE_MASK            = C.GdkEventMask(C.GDK_EXPOSURE_MASK)
	POINTER_MOTION_MASK      = C.GdkEventMask(C.GDK_POINTER_MOTION_MASK)
	POINTER_MOTION_HINT_MASK = C.GdkEventMask(C.GDK_POINTER_MOTION_HINT_MASK)
	BUTTON_MOTION_MASK       = C.GdkEventMask(C.GDK_BUTTON_MOTION_MASK)
	BUTTON1_MOTION_MASK      = C.GdkEventMask(C.GDK_BUTTON1_MOTION_MASK)
	BUTTON2_MOTION_MASK      = C.GdkEventMask(C.GDK_BUTTON2_MOTION_MASK)
	BUTTON3_MOTION_MASK      = C.GdkEventMask(C.GDK_BUTTON3_MOTION_MASK)
	BUTTON_PRESS_MASK        = C.GdkEventMask(C.GDK_BUTTON_PRESS_MASK)
	BUTTON_RELEASE_MASK      = C.GdkEventMask(C.GDK_BUTTON_RELEASE_MASK)
	KEY_PRESS_MASK           = C.GdkEventMask(C.GDK_KEY_PRESS_MASK)
	KEY_RELEASE_MASK         = C.GdkEventMask(C.GDK_KEY_RELEASE_MASK)
	ENTER_NOTIFY_MASK        = C.GdkEventMask(C.GDK_ENTER_NOTIFY_MASK)
	LEAVE_NOTIFY_MASK        = C.GdkEventMask(C.GDK_LEAVE_NOTIFY_MASK)
	FOCUS_CHANGE_MASK        = C.GdkEventMask(C.GDK_FOCUS_CHANGE_MASK)
	STRUCTURE_MASK           = C.GdkEventMask(C.GDK_STRUCTURE_MASK)
	PROPERTY_CHANGE_MASK     = C.GdkEventMask(C.GDK_PROPERTY_CHANGE_MASK)