startX = (int) gdkEvent.x; startY = (int) gdkEvent.y;
int window = OS.GTK_WIDGET_WINDOW (widget); int [] origin_x = new int [1], origin_y = new int [1]; OS.gdk_window_get_origin (window, origin_x, origin_y); startX = (int) (gdkEvent.x_root - origin_x [0]); startY = (int) (gdkEvent.y_root - origin_y [0]);
int gtk_button_press_event (int widget, int eventPtr) {	int result = super.gtk_button_press_event (widget, eventPtr);	GdkEventButton gdkEvent = new GdkEventButton ();	OS.memmove (gdkEvent, eventPtr, GdkEventButton.sizeof);	int button = gdkEvent.button;	if (button != 1) return 0;	startX = (int) gdkEvent.x; 	startY = (int) gdkEvent.y;	int border = 0;	int x = OS.GTK_WIDGET_X (handle);	int y = OS.GTK_WIDGET_Y (handle);	int width = OS.GTK_WIDGET_WIDTH (handle);	int height = OS.GTK_WIDGET_HEIGHT (handle);	lastX = x - border; 	lastY = y - border;	/* The event must be sent because its doit flag is used. */	Event event = new Event ();	event.detail = SWT.DRAG;	event.time = gdkEvent.time;	event.x = lastX;	event.y = lastY;	event.width = width;	event.height = height;	/*	 * It is possible (but unlikely) that client code could have disposed	 * the widget in the selection event.  If this happens end the processing	 * of this message by returning.	 */	sendEvent (SWT.Selection, event);	if (isDisposed ()) return 0;	if (event.doit) {		dragging = true;		drawBand (lastX = event.x, lastY = event.y, width, height);	}	return result;	}