mask.length / 2, mask, toolTipWindowHandle, null);
mask.length / 2, mask, toolTipWindowHandle, refHandler); fToolTipRefHandler= refHandler[0];
void showToolTip (int handle, String toolTipText) {	if (toolTipText == null || toolTipText.length () == 0) {		if (toolTipWindowHandle != 0)			OS.HideWindow(toolTipWindowHandle);		return;	}	if (toolTipWindowHandle != 0)		 return;		if (handle != fCurrentControl) {		//System.out.println("Display.showToolTip: handle is not current");		//beep();		return;	}	if (fMenuIsVisible) {		//System.out.println("Display.showToolTip: menu is visible");		//beep();		return;	}		if (OS.StillDown()) {		//System.out.println("Display.showToolTip: button is down");		//beep();		return;	}			toolTipText= MacUtil.removeMnemonics(toolTipText);		// remember text	fToolTipText= toolTipText;		// calculate text bounding box	short[] bounds= new short[2];	short[] baseLine= new short[1];	int sHandle= OS.CFStringCreateWithCharacters(toolTipText);	OS.GetThemeTextDimensions(sHandle, fHoverThemeFont, OS.kThemeStateActive, false, bounds, baseLine);	if (bounds[1] > 200) {	// too wide -> wrap text		bounds[1]= (short) 200;		OS.GetThemeTextDimensions(sHandle, fHoverThemeFont, OS.kThemeStateActive, true, bounds, baseLine);	}	OS.CFRelease(sHandle);	int width= bounds[1] + 2*TOOLTIP_MARGIN;	int height= bounds[0] + 2*TOOLTIP_MARGIN;		// position just below mouse cursor	org.eclipse.swt.internal.carbon.Point loc= new org.eclipse.swt.internal.carbon.Point();	OS.GetGlobalMouse(loc);	int x= loc.h + 16;	int y= loc.v + 16;	// Ensure that the tool tip is on the screen.	Rect screenBounds= new Rect();	OS.GetAvailableWindowPositioningBounds(OS.GetMainDevice(), screenBounds);	x = Math.max (0, Math.min (x, screenBounds.right - screenBounds.left - width ));	y = Math.max (0, Math.min (y, screenBounds.bottom - screenBounds.top - height ));	// create window	int[] wHandle= new int[1];	Rect rect = new Rect();	rect.left = (short)x;	rect.top = (short)y;	rect.right = (short)(x + width);	rect.bottom = (short)(y + height);	if (OS.CreateNewWindow(OS.kHelpWindowClass, 0, rect, wHandle) == OS.noErr) {		toolTipWindowHandle= wHandle[0];		int[] mask= new int[] {			OS.kEventClassWindow, OS.kEventWindowDrawContent		};		OS.InstallEventHandler(OS.GetWindowEventTarget(toolTipWindowHandle), fTooltipWindowProc,					mask.length / 2, mask, toolTipWindowHandle, null);		OS.ShowWindow(toolTipWindowHandle);		fLastHoverHandle= handle;	}}