Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsProblems with Text control
https://www.eclipse.org/forums/index.php/mv/msg/137193/432867/#msg_432867
I want to create a multiline Text control using the native Text widget.
The problem with the above snippet is that I cannot introduce more than 7
lines of text.
Well, in the examples provided by Eclipse (ControlExample) the Text control
created with SWT.MULTI it has'nt this limitation.
What is wrong in my snippet ?
/**
* @author Robert Bacs
*/
public class XTableTest {
public static void main(String []args){
final Display display = new Display();
final Shell shell = new Shell(display);
shell.setLayout(new GridLayout());
Group textGroup = new Group (shell, SWT.NULL);
textGroup.setLayout (new GridLayout ());
textGroup.setLayoutData (new GridData (GridData.GRAB_HORIZONTAL |
GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
textGroup.setText ("Text");
Text text = new Text(textGroup, SWT.MULTI);
int size = 100;
GridData gridData = new GridData ();
gridData.widthHint = size;
gridData.heightHint = size;
text.setLayoutData(gridData);
text.setText("Multiline\nText\ncontrol");
shell.pack();
shell.open();
while (!shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
}
}]]>Robert Bacs2004-03-30T12:04:31-00:00Re: Problems with Text control
https://www.eclipse.org/forums/index.php/mv/msg/137193/432935/#msg_432935
2) The problem has already been worked around in SWT 3.0 (SWT.V_SCROLL
should not be necessary but it's not harmful).
"Robert Bacs" <boby@zerosoft.ro> wrote in message
news:c4bms6$9qe$1@eclipse.org...
> Hi,
>
> I want to create a multiline Text control using the native Text widget.
> The problem with the above snippet is that I cannot introduce more than 7
> lines of text.
> Well, in the examples provided by Eclipse (ControlExample) the Text
control
> created with SWT.MULTI it has'nt this limitation.
> What is wrong in my snippet ?
>
>
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.layout.*;
> import org.eclipse.swt.widgets.*;
>
> /**
> * @author Robert Bacs
> */
> public class XTableTest {
> public static void main(String []args){
> final Display display = new Display();
> final Shell shell = new Shell(display);
> shell.setLayout(new GridLayout());
>
> Group textGroup = new Group (shell, SWT.NULL);
> textGroup.setLayout (new GridLayout ());
> textGroup.setLayoutData (new GridData (GridData.GRAB_HORIZONTAL |
> GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
> textGroup.setText ("Text");
>
> Text text = new Text(textGroup, SWT.MULTI);
> int size = 100;
> GridData gridData = new GridData ();
> gridData.widthHint = size;
> gridData.heightHint = size;
> text.setLayoutData(gridData);
> text.setText("Multiline\nText\ncontrol");
>
> shell.pack();
> shell.open();
>
> while (!shell.isDisposed ()) {
> if (!display.readAndDispatch ()) display.sleep ();
> }
> display.dispose ();
> }
> }
>
>
>]]>Steve Northover2004-03-30T14:16:10-00:00Re: Problems with Text control
https://www.eclipse.org/forums/index.php/mv/msg/137193/432944/#msg_432944
Yes, I know that, but in the ControlExample it's working without
SWT.V_SCROLL and I'm runninng with the same SWT version both example
(ControlExample and my snippet).
What is the difference between my snippet and the example provided by
ControlExample ?
Because, I do not see any !
Best regards,
Boby
"Steve Northover" <steve_northover@ca.ibm.com> wrote in message
news:c4bv5u$lh4$1@eclipse.org...
> 1) Give it a vertical scroll bar using SWT.V_SCROLL (in SWT 2.1.x)
> 2) The problem has already been worked around in SWT 3.0 (SWT.V_SCROLL
> should not be necessary but it's not harmful).
>
> "Robert Bacs" <boby@zerosoft.ro> wrote in message
> news:c4bms6$9qe$1@eclipse.org...
> > Hi,
> >
> > I want to create a multiline Text control using the native Text widget.
> > The problem with the above snippet is that I cannot introduce more than
7
> > lines of text.
> > Well, in the examples provided by Eclipse (ControlExample) the Text
> control
> > created with SWT.MULTI it has'nt this limitation.
> > What is wrong in my snippet ?
> >
> >
> > import org.eclipse.swt.SWT;
> > import org.eclipse.swt.layout.*;
> > import org.eclipse.swt.widgets.*;
> >
> > /**
> > * @author Robert Bacs
> > */
> > public class XTableTest {
> > public static void main(String []args){
> > final Display display = new Display();
> > final Shell shell = new Shell(display);
> > shell.setLayout(new GridLayout());
> >
> > Group textGroup = new Group (shell, SWT.NULL);
> > textGroup.setLayout (new GridLayout ());
> > textGroup.setLayoutData (new GridData (GridData.GRAB_HORIZONTAL |
> > GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
> > textGroup.setText ("Text");
> >
> > Text text = new Text(textGroup, SWT.MULTI);
> > int size = 100;
> > GridData gridData = new GridData ();
> > gridData.widthHint = size;
> > gridData.heightHint = size;
> > text.setLayoutData(gridData);
> > text.setText("Multiline\nText\ncontrol");
> >
> > shell.pack();
> > shell.open();
> >
> > while (!shell.isDisposed ()) {
> > if (!display.readAndDispatch ()) display.sleep ();
> > }
> > display.dispose ();
> > }
> > }
> >
> >
> >
>
>]]>Robert Bacs2004-03-30T15:30:25-00:00Re: Problems with Text control
https://www.eclipse.org/forums/index.php/mv/msg/137193/433000/#msg_433000
I found the difference: in the Java build path I have two version of swt.jar
:).
Best regards,
Boby
"Robert Bacs" <boby@zerosoft.ro> wrote in message
news:c4c2ua$r78$1@eclipse.org...
> Hi,
>
> Yes, I know that, but in the ControlExample it's working without
> SWT.V_SCROLL and I'm runninng with the same SWT version both example
> (ControlExample and my snippet).
> What is the difference between my snippet and the example provided by
> ControlExample ?
> Because, I do not see any !
>
> Best regards,
> Boby
>
>
> "Steve Northover" <steve_northover@ca.ibm.com> wrote in message
> news:c4bv5u$lh4$1@eclipse.org...
> > 1) Give it a vertical scroll bar using SWT.V_SCROLL (in SWT 2.1.x)
> > 2) The problem has already been worked around in SWT 3.0 (SWT.V_SCROLL
> > should not be necessary but it's not harmful).
> >
> > "Robert Bacs" <boby@zerosoft.ro> wrote in message
> > news:c4bms6$9qe$1@eclipse.org...
> > > Hi,
> > >
> > > I want to create a multiline Text control using the native Text
widget.
> > > The problem with the above snippet is that I cannot introduce more
than
> 7
> > > lines of text.
> > > Well, in the examples provided by Eclipse (ControlExample) the Text
> > control
> > > created with SWT.MULTI it has'nt this limitation.
> > > What is wrong in my snippet ?
> > >
> > >
> > > import org.eclipse.swt.SWT;
> > > import org.eclipse.swt.layout.*;
> > > import org.eclipse.swt.widgets.*;
> > >
> > > /**
> > > * @author Robert Bacs
> > > */
> > > public class XTableTest {
> > > public static void main(String []args){
> > > final Display display = new Display();
> > > final Shell shell = new Shell(display);
> > > shell.setLayout(new GridLayout());
> > >
> > > Group textGroup = new Group (shell, SWT.NULL);
> > > textGroup.setLayout (new GridLayout ());
> > > textGroup.setLayoutData (new GridData (GridData.GRAB_HORIZONTAL |
> > > GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
> > > textGroup.setText ("Text");
> > >
> > > Text text = new Text(textGroup, SWT.MULTI);
> > > int size = 100;
> > > GridData gridData = new GridData ();
> > > gridData.widthHint = size;
> > > gridData.heightHint = size;
> > > text.setLayoutData(gridData);
> > > text.setText("Multiline\nText\ncontrol");
> > >
> > > shell.pack();
> > > shell.open();
> > >
> > > while (!shell.isDisposed ()) {
> > > if (!display.readAndDispatch ()) display.sleep ();
> > > }
> > > display.dispose ();
> > > }
> > > }
> > >
> > >
> > >
> >
> >
>
>]]>Robert Bacs2004-03-31T13:46:21-00:00