void createHandle () { state |= CANVAS; boolean scrolled = (style & (SWT.V_SCROLL | SWT.H_SCROLL)) != 0; if (!scrolled) state |= THEME_BACKGROUND; NSRect rect = new NSRect(); if (scrolled || hasBorder ()) { NSScrollView scrollWidget = (NSScrollView)new SWTScrollView().alloc(); scrollWidget.initWithFrame (rect); scrollWidget.setDrawsBackground(false); if ((style & SWT.H_SCROLL) != 0) scrollWidget.setHasHorizontalScroller(true); if ((style & SWT.V_SCROLL) != 0) scrollWidget.setHasVerticalScroller(true); scrollWidget.setBorderType(hasBorder() ? OS.NSBezelBorder : OS.NSNoBorder); scrollView = scrollWidget; } NSView widget = (NSView)new SWTCanvasView().alloc(); widget.initWithFrame (rect); // widget.setFocusRingType(OS.NSFocusRingTypeExterior); view = widget; if (scrollView != null) { NSClipView contentView = scrollView.contentView(); contentView.setAutoresizesSubviews(true); view.setAutoresizingMask(OS.NSViewWidthSizable | OS.NSViewHeightSizable); } }
int vsp = (style & SWT.V_SCROLL) != 0 ? OS.GTK_POLICY_ALWAYS : OS.GTK_POLICY_NEVER; OS.gtk_scrolled_window_set_policy (scrolledHandle, hsp, vsp); if (hasBorder ()) { OS.gtk_scrolled_window_set_shadow_type (scrolledHandle, OS.GTK_SHADOW_ETCHED_IN);
int vsp = (style & SWT.V_SCROLL) != 0 ? OS.GTK_POLICY_ALWAYS : OS.GTK_POLICY_NEVER; OS.gtk_scrolled_window_set_policy (scrolledHandle, hsp, vsp); if (hasBorder ()) { OS.gtk_scrolled_window_set_shadow_type (scrolledHandle, OS.GTK_SHADOW_ETCHED_IN);
int vsp = (style & SWT.V_SCROLL) != 0 ? OS.GTK_POLICY_ALWAYS : OS.GTK_POLICY_NEVER; OS.gtk_scrolled_window_set_policy (scrolledHandle, hsp, vsp); if (hasBorder ()) { OS.gtk_scrolled_window_set_shadow_type (scrolledHandle, OS.GTK_SHADOW_ETCHED_IN);