XtWidgetGeometry result = new XtWidgetGeometry (); OS.XtQueryGeometry (labelHandle, null, result); int titleWidth = result.width + 2 * (argList2 [5] + marginWidth + thickness + borderWidth); trimWidth = Math.max (trimWidth, titleWidth);
public Rectangle computeTrim (int x, int y, int width, int height) {	checkWidget();	int trimX, trimY, trimWidth, trimHeight;		int [] argList = {		OS.XmNshadowThickness, 0, 		OS.XmNmarginWidth, 0, 		OS.XmNmarginHeight, 0	};	OS.XtGetValues (handle, argList, argList.length / 2);	int thickness = argList [1];	int marginWidth = argList [3];	int marginHeight = argList [5];	int borderWidth = getBorderWidth ();	trimX = x - marginWidth + thickness - borderWidth;	trimY = y - marginHeight + thickness - borderWidth;	trimWidth = width + ((marginWidth + thickness + borderWidth) * 2);	trimHeight = height + ((marginHeight + thickness + borderWidth) * 2);	if (OS.XtIsManaged (labelHandle)) {		int [] argList2 = {OS.XmNy, 0, OS.XmNheight, 0, OS.XmNchildHorizontalSpacing, 0};		OS.XtGetValues (labelHandle, argList2, argList2.length / 2);		int titleHeight = ((short) argList2 [1]) + argList2 [3];		trimY = y - titleHeight;		trimHeight = height + titleHeight + (marginHeight + thickness + borderWidth);		XtWidgetGeometry result = new XtWidgetGeometry ();		OS.XtQueryGeometry (labelHandle, null, result);		int titleWidth = result.width + 2 * (argList2 [5] + marginWidth + thickness + borderWidth);		trimWidth = Math.max (trimWidth, titleWidth);	}	return new Rectangle (trimX, trimY, trimWidth, trimHeight);}