Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Table with only 1 column
Table with only 1 column [message #464760] Tue, 29 November 2005 15:59 Go to next message
Eclipse UserFriend
Originally posted by: valerie.berthie.laposteNOSPAM.net

Hi,
I'm trying to do a very simple thing : a table with only 1 column, with
visible header.
Is there a way to force the column to use all available space ?
I don't know why but there is a small space on the right of the column, as
if there was a second column that was not completely displayed.
(You can see exactly this behavior in SWT samples : SWT Controls / Table
Tab)
When the vertical scroll bar appears, this small space is hidden by the
scroll bar, and the problem is solved. But what to do when there is no
scroll bar ?

I've tried to force the column width to be equal to the table width... I've
also tried to call pack() and layout(). I've tied setResizable(false) But it
still doesn't work.
Is it a bug or do I miss something ?
Thanks in advance
Valerie
Re: Table with only 1 column [message #464772 is a reply to message #464760] Tue, 29 November 2005 18:02 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
The space is for the vertical scrollbar. You can eliminate the space by
correctly setting the width of the table column. See the following snippet:

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet77.java?rev=HEAD&a mp;content-type=text/vnd.viewcvs-markup

Note that it in this snippet it is very important to listen to the Resize
event of the parent of the Table (not the Table itself).

"Valerie Berthie" <valerie.berthie@laposteNOSPAM.net> wrote in message
news:dmhtud$9rv$1@news.eclipse.org...
> Hi,
> I'm trying to do a very simple thing : a table with only 1 column, with
> visible header.
> Is there a way to force the column to use all available space ?
> I don't know why but there is a small space on the right of the column, as
> if there was a second column that was not completely displayed.
> (You can see exactly this behavior in SWT samples : SWT Controls / Table
> Tab)
> When the vertical scroll bar appears, this small space is hidden by the
> scroll bar, and the problem is solved. But what to do when there is no
> scroll bar ?
>
> I've tried to force the column width to be equal to the table width...
> I've
> also tried to call pack() and layout(). I've tied setResizable(false) But
> it
> still doesn't work.
> Is it a bug or do I miss something ?
> Thanks in advance
> Valerie
>
>
>
>
Previous Topic:Missing keyborad events
Next Topic:size of a composite
Goto Forum:
  


Current Time: Tue Apr 16 14:49:56 GMT 2024

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

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

Back to the top