Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Williams2017-09-25 13:29:39 -0400
committerEric Williams2017-09-25 13:29:44 -0400
commit71b711bf9343a010e0e2f7ccb7d075dc757a6043 (patch)
treebe117471445f746ec7768851314c025b0db78a87
parentbdaf68d5b28b47ddfaaed68ea77705a26e1f02be (diff)
downloadeclipse.platform.swt-71b711bf9343a010e0e2f7ccb7d075dc757a6043.tar.gz
eclipse.platform.swt-71b711bf9343a010e0e2f7ccb7d075dc757a6043.tar.xz
eclipse.platform.swt-71b711bf9343a010e0e2f7ccb7d075dc757a6043.zip
Bug 515915: [GTK3] ScrolledComposite within CTabFolder does not show
scrollbars until resize Add test snippet to snippet repo. Change-Id: I6d8c7caf5a29eacd3e6bbbe100ea24adefaf8b57 Signed-off-by: Eric Williams <ericwill@redhat.com>
-rw-r--r--tests/org.eclipse.swt.tests.gtk/Bug Snippets/org/eclipse/swt/tests/gtk/snippets/Bug515915_ScrolledCompositeCTabFolder.java59
1 files changed, 59 insertions, 0 deletions
diff --git a/tests/org.eclipse.swt.tests.gtk/Bug Snippets/org/eclipse/swt/tests/gtk/snippets/Bug515915_ScrolledCompositeCTabFolder.java b/tests/org.eclipse.swt.tests.gtk/Bug Snippets/org/eclipse/swt/tests/gtk/snippets/Bug515915_ScrolledCompositeCTabFolder.java
new file mode 100644
index 0000000000..73e313f8bd
--- /dev/null
+++ b/tests/org.eclipse.swt.tests.gtk/Bug Snippets/org/eclipse/swt/tests/gtk/snippets/Bug515915_ScrolledCompositeCTabFolder.java
@@ -0,0 +1,59 @@
+package org.eclipse.swt.tests.gtk.snippets;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.custom.CTabItem;
+import org.eclipse.swt.custom.ScrolledComposite;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+
+/*
+ * Title: Bug 515915 - [GTK3] ScrolledComposite within CTabFolder does not show scrollbars until resize
+ * How to run: launch snippet and observe scrollbar area
+ * Bug description: The scrollbar does not appear until the window is resized
+ * Expected results: The scrollbar appears immediately when the snippet runs
+ * GTK Version(s): GTK3
+ */
+public class Bug515915_ScrolledCompositeCTabFolder
+{
+ public static void main(String[] args)
+ {
+ Display display = new Display();
+ Shell shell = new Shell(display);
+ shell.setLayout(new FillLayout());
+ shell.setSize(100, 150);
+
+ CTabFolder tabFolder = new CTabFolder(shell, SWT.NONE);
+ tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ CTabItem tabItem = new CTabItem(tabFolder, SWT.NONE);
+ tabItem.setText("Tab");
+
+ ScrolledComposite scroller = new ScrolledComposite(tabFolder, SWT.V_SCROLL | SWT.H_SCROLL);
+ scroller.setExpandHorizontal(true);
+ scroller.setExpandVertical(true);
+ tabItem.setControl(scroller);
+
+ Label label = new Label(scroller, SWT.NONE);
+ label.setText("Label\n with\n a\n tall\n text\n string\n inside\n of\n it.");
+ label.pack();
+
+ scroller.setContent(label);
+ scroller.setMinSize(label.computeSize(SWT.DEFAULT, SWT.DEFAULT));
+
+ shell.open();
+
+ while (!shell.isDisposed())
+ {
+ if (!display.readAndDispatch())
+ {
+ display.sleep();
+ }
+ }
+
+ display.dispose();
+ }
+} \ No newline at end of file

Back to the top