Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Textbox resize strange behavior
Textbox resize strange behavior [message #1023921] Mon, 25 March 2013 13:11
Jürgen Weinberger is currently offline Jürgen WeinbergerFriend
Messages: 42
Registered: August 2012
Member
Hi! I extracted following Snippet for reproduction. For me it seems like an eclipse/swt bug but maybe somebody knows more.

The Problem occurs when i enter a text in the textbox. Than i start to resize the window horizontally so that the text gets hidden. Now when i resize the window to a bigger size again, sometimes the text is missing or only shown half depending on the speed of the resize/mouse move. The Problem there is that the cursor in the textbox is not set right (to the end or beginning of the text).

This doesn't happen if in the "Windows Desktop Settings/Themes -> Effects -> Show window content when resizing" is turned off. Sorry i only have a german Windows Version so i can't say the exact english name of the option.
By the way i am working with WinXP professional and eclipse 3.6

Maybe somebody has an idea or suggestion how to work around this limitation.

Thanks and best regards
Weinma

package test;

import org.eclipse.core.databinding.observable.Realm;
import org.eclipse.jface.databinding.swt.SWTObservables;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;


public class TextTestMain {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		final Display display = new Display();
		Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() {
			
			public void run() {
				
				Shell shell = new Shell(display);
			
				createControl(shell);
				
				shell.open();
				
				while (!shell.isDisposed()) {
					if (!display.readAndDispatch())
					    display.sleep();
				}
			}
		});
		display.dispose(); 
	
	}

	private static void createControl(Shell shell) {
		
		shell.setLayout(new FillLayout());
		Composite parent = new Composite(shell,SWT.BORDER);
		
		GridLayoutFactory.fillDefaults().numColumns(3).applyTo(parent);
		
		Label label = new Label(parent, SWT.NONE);
		label.setText("asdklsadflkaösdlföknaslökdfnlökwadnfölan");
		GridDataFactory.fillDefaults().grab(true, true).applyTo(label);
		
		Text text = new Text(parent,SWT.BORDER);
		GridDataFactory.fillDefaults().grab(true, true).applyTo(text);

		Label label1 = new Label(parent, SWT.NONE);
		label1.setText("blablablabla");
		GridDataFactory.fillDefaults().applyTo(label1);
		
		shell.pack();
	}

}


Previous Topic:Eclipse with Processing
Next Topic:menucontribution appears only in one perspective
Goto Forum:
  


Current Time: Tue Mar 19 08:06:41 GMT 2024

Powered by FUDForum. Page generated in 0.02056 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top