if (wHint != SWT.DEFAULT && wHint < 0) wHint = 0; if (hHint != SWT.DEFAULT && hHint < 0) hHint = 0; Point size = computeNativeSize (handle, wHint, hHint, changed); int border = OS.gtk_container_get_border_width (handle); size.x += 2 * border; size.y += 2 * border; return size;
if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) { if (wHint != SWT.DEFAULT && wHint < 0) wHint = 0; if (hHint != SWT.DEFAULT && hHint < 0) hHint = 0; Point size = computeNativeSize (handle, wHint, hHint, changed); int border = OS.gtk_container_get_border_width (handle); size.x += 2 * border; size.y += 2 * border; return size; } else { int height = 0, width = 0; if (wHint == SWT.DEFAULT || hHint == SWT.DEFAULT) { if (itemCount > 0) { height += spacing; GC gc = new GC (this); for (int i = 0; i < itemCount; i++) { ExpandItem item = items [i]; height += item.getHeaderHeight (); if (item.expanded) height += item.height; height += spacing; width = Math.max (width, item.getPreferredWidth (gc)); } gc.dispose (); } } if (width == 0) width = DEFAULT_WIDTH; if (height == 0) height = DEFAULT_HEIGHT; if (wHint != SWT.DEFAULT) width = wHint; if (hHint != SWT.DEFAULT) height = hHint; return new Point (width, height); }
public Point computeSize (int wHint, int hHint, boolean changed) {	if (wHint != SWT.DEFAULT && wHint < 0) wHint = 0;	if (hHint != SWT.DEFAULT && hHint < 0) hHint = 0;	Point size = computeNativeSize (handle, wHint, hHint, changed);	int border = OS.gtk_container_get_border_width (handle);	size.x += 2 * border;	size.y += 2 * border;	return size;}