Text widget - auto-resizing, shouldn't [message #443053] |
Fri, 17 September 2004 19:22 |
Arthur Casals Messages: 6 Registered: July 2009 |
Junior Member |
|
|
Hello,
I'm using a little shell to get some input texts, so I've used a
GridLayout on it, with two columns (Labels go left, Texts go right,
Buttons go below). Since I'm using a Combo in the right column, all the
Texts auto-size to the Combo´s width, making the layout beautiful and
everyone happy. The problem is: when I edit all the text I've input, the
Texts receive the old values (using append or setText, I've tried both),
and they auto-resize their width to the old input's length... so, if the
original input for a specific Text was "a", for example, this widget
auto-resizes its to fit only one char (width). Not beautiful. Any ideas? :)
Regards,
Arthur Casals
|
|
|
|
Re: Text widget - auto-resizing, shouldn't [message #443108 is a reply to message #443066] |
Sat, 18 September 2004 01:33 |
Arthur Casals Messages: 6 Registered: July 2009 |
Junior Member |
|
|
Steve Northover wrote:
> I assume you are doing this in an SWT.Verify handler or SWT.KeyDown handler?
In fact, it's simpler than that... s'th like this:
final Button button_OpenShell = new Button(parentShell, SWT.NONE);
button_OpenShell.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
Shell shell = new Shell(SWT.FOO);
final GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 2;
shell.setLayout(gridLayout);
shell.setBounds(300,300,172, 227);
shell.setText("Shell");
final Text text = new Text(shell, SWT.BORDER);
text.setText(table.getItem(index).getText(0));
}
});
Then, table.getItem(index).getText(0) rules the (Text)text width...
Any sugestions?
Regards,
Arthur Casals
|
|
|
|
Powered by
FUDForum. Page generated in 0.03862 seconds