Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Text mimum width and SWT.H_SCROLL
Text mimum width and SWT.H_SCROLL [message #466173] Wed, 04 January 2006 14:40 Go to next message
drew frantz is currently offline drew frantzFriend
Messages: 340
Registered: July 2009
Senior Member
I want a text field to have a minmum width and display the horiz scroll when
the text exceeds the min width. What is the trick to do this?

If i specify layout daya for the Text control and create the control with
with h_scroll the scroll bars never appear .

theControl = new Text(groupBasic, SWT.BORDER|SWT.H_SCROLL);

GridData myDefaultWidthData = new GridData();
myDefaultWidthData.grabExcessHorizontalSpace=true;
myDefaultWidthData.minimumWidth=DEFAULT_WIDTH;

theControl.setLayoutData(myDefaultWidthData);
Re: Text mimum width and SWT.H_SCROLL [message #466286 is a reply to message #466173] Thu, 05 January 2006 20:54 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
How big is DEFAULT_WIDTH?

"Drew" <drew@acm.org> wrote in message
news:dpgmqp$uv4$1@utils.eclipse.org...
>I want a text field to have a minmum width and display the horiz scroll
>when
> the text exceeds the min width. What is the trick to do this?
>
> If i specify layout daya for the Text control and create the control with
> with h_scroll the scroll bars never appear .
>
> theControl = new Text(groupBasic, SWT.BORDER|SWT.H_SCROLL);
>
> GridData myDefaultWidthData = new GridData();
> myDefaultWidthData.grabExcessHorizontalSpace=true;
> myDefaultWidthData.minimumWidth=DEFAULT_WIDTH;
>
> theControl.setLayoutData(myDefaultWidthData);
>
>
Previous Topic:Linux-gtk and TableEditors problem
Next Topic:How to let Table specify different alighment for one column and its cells
Goto Forum:
  


Current Time: Thu Apr 25 15:47:15 GMT 2024

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

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

Back to the top