super.hookEvents (); OS.g_signal_connect_closure (entryHandle, OS.changed, display.closures [CHANGED], true); OS.g_signal_connect_closure (entryHandle, OS.insert_text, display.closures [INSERT_TEXT], false); OS.g_signal_connect_closure (entryHandle, OS.delete_text, display.closures [DELETE_TEXT], false); OS.g_signal_connect_closure (entryHandle, OS.activate, display.closures [ACTIVATE], false);
if (entryHandle != 0) { OS.g_signal_connect_closure (entryHandle, OS.changed, display.closures [CHANGED], true); OS.g_signal_connect_closure (entryHandle, OS.insert_text, display.closures [INSERT_TEXT], false); OS.g_signal_connect_closure (entryHandle, OS.delete_text, display.closures [DELETE_TEXT], false); OS.g_signal_connect_closure (entryHandle, OS.activate, display.closures [ACTIVATE], false); }
void hookEvents () {	//TODO - fix multiple enter/exit	super.hookEvents ();	OS.g_signal_connect_closure (entryHandle, OS.changed, display.closures [CHANGED], true);	OS.g_signal_connect_closure (entryHandle, OS.insert_text, display.closures [INSERT_TEXT], false);	OS.g_signal_connect_closure (entryHandle, OS.delete_text, display.closures [DELETE_TEXT], false);	OS.g_signal_connect_closure (entryHandle, OS.activate, display.closures [ACTIVATE], false);	int eventMask =	OS.GDK_POINTER_MOTION_MASK | OS.GDK_BUTTON_PRESS_MASK |		OS.GDK_BUTTON_RELEASE_MASK | OS.GDK_ENTER_NOTIFY_MASK |		OS.GDK_LEAVE_NOTIFY_MASK;	int /*long*/ [] handles = new int /*long*/ [] {arrowHandle, entryHandle, listHandle};	for (int i=0; i<handles.length; i++) {		int /*long*/ eventHandle = handles [i];		if (eventHandle != 0) {			/* Connect the mouse signals */			OS.gtk_widget_add_events (eventHandle, eventMask);			OS.g_signal_connect_closure_by_id (eventHandle, display.signalIds [BUTTON_PRESS_EVENT], 0, display.closures [BUTTON_PRESS_EVENT], false);			OS.g_signal_connect_closure_by_id (eventHandle, display.signalIds [BUTTON_RELEASE_EVENT], 0, display.closures [BUTTON_RELEASE_EVENT], false);			OS.g_signal_connect_closure_by_id (eventHandle, display.signalIds [MOTION_NOTIFY_EVENT], 0, display.closures [MOTION_NOTIFY_EVENT], false);			OS.g_signal_connect_closure_by_id (eventHandle, display.signalIds [ENTER_NOTIFY_EVENT], 0, display.closures [ENTER_NOTIFY_EVENT], false);			OS.g_signal_connect_closure_by_id (eventHandle, display.signalIds [LEAVE_NOTIFY_EVENT], 0, display.closures [LEAVE_NOTIFY_EVENT], false);			/*			* Feature in GTK.  Events such as mouse move are propagated up			* the widget hierarchy and are seen by the parent.  This is the			* correct GTK behavior but not correct for SWT.  The fix is to			* hook a signal after and stop the propagation using a negative			* event number to distinguish this case.			*/			OS.g_signal_connect_closure_by_id (eventHandle, display.signalIds [BUTTON_PRESS_EVENT], 0, display.closures [BUTTON_PRESS_EVENT_INVERSE], true);			OS.g_signal_connect_closure_by_id (eventHandle, display.signalIds [BUTTON_RELEASE_EVENT], 0, display.closures [BUTTON_RELEASE_EVENT_INVERSE], true);			OS.g_signal_connect_closure_by_id (eventHandle, display.signalIds [MOTION_NOTIFY_EVENT], 0, display.closures [MOTION_NOTIFY_EVENT_INVERSE], true);			/* Connect the event_after signal for both key and mouse */			if (eventHandle != entryHandle) {				OS.g_signal_connect_closure_by_id (eventHandle, display.signalIds [EVENT_AFTER], 0, display.closures [EVENT_AFTER], false);			}		}	}	int /*long*/ imContext = imContext ();	if (imContext != 0) {		OS.g_signal_connect_closure (imContext, OS.commit, display.closures [COMMIT], false);		int id = OS.g_signal_lookup (OS.commit, OS.gtk_im_context_get_type ());		int blockMask =  OS.G_SIGNAL_MATCH_DATA | OS.G_SIGNAL_MATCH_ID;		OS.g_signal_handlers_block_matched (imContext, blockMask, id, 0, 0, 0, entryHandle);	}	}