Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Can the Column Width in a TableViewer to be smaller than the Column Text?
Can the Column Width in a TableViewer to be smaller than the Column Text? [message #459380] Mon, 08 August 2005 14:21 Go to next message
J. Shanonn is currently offline J. ShanonnFriend
Messages: 12
Registered: July 2009
Junior Member
Hi There,
I'm using a Table Viewer and would like the user to be able to resize the
widths of the columns (be dragging) to be less than the width of the
Column Header Text? I've found that I can programatically set the width
to 0, which effectively hides the column, but I would like the width to
default to a size less than the size of the column text - hiding the
column doesn't help me.

I should mention that right now I'm setting the layout of the table to a
GridData with Parameters of FILL_HORIZONTAL and FILL_VERTICAL. This is
what's causing my problem - I want the table columns to fill the available
horizontal and vertical space, but still allow the user to have some
control over the size of the columns. Can anyone offer any advice?

Thanks
JS
Re: Can the Column Width in a TableViewer to be smaller than the Column Text? [message #459381 is a reply to message #459380] Mon, 08 August 2005 14:29 Go to previous messageGo to next message
Yves Harms is currently offline Yves HarmsFriend
Messages: 80
Registered: July 2009
Member
Try to put the table into a Composite with FillLayout.
This way you shouldn'tneed to temper the internal layout settings of the
table.

J Shannon wrote:
> Hi There,
> I'm using a Table Viewer and would like the user to be able to resize
> the widths of the columns (be dragging) to be less than the width of the
> Column Header Text? I've found that I can programatically set the width
> to 0, which effectively hides the column, but I would like the width to
> default to a size less than the size of the column text - hiding the
> column doesn't help me.
> I should mention that right now I'm setting the layout of the table to a
> GridData with Parameters of FILL_HORIZONTAL and FILL_VERTICAL. This is
> what's causing my problem - I want the table columns to fill the
> available horizontal and vertical space, but still allow the user to
> have some control over the size of the columns. Can anyone offer any
> advice?
>
> Thanks JS
>
Re: Can the Column Width in a TableViewer to be smaller than the Column Text? [message #459385 is a reply to message #459381] Mon, 08 August 2005 15:35 Go to previous messageGo to next message
J. Shanonn is currently offline J. ShanonnFriend
Messages: 12
Registered: July 2009
Junior Member
Hi Yves,
Thanks for responding so quickly to my post...I tried your suggestion and
I still cannot resize the columns to be smaller than their labels. Do you
see anything in the code below that would be causing my problem?

FillLayout fillLayout = new FillLayout();

fillLayout.type = SWT.HORIZONTAL;


Composite composite = new Composite(parent, SWT.NONE);

composite.setLayout(fillLayout);



TableViewer viewer = new TableViewer(composite);

Jason
Re: Can the Column Width in a TableViewer to be smaller than the Column Text? [message #459402 is a reply to message #459385] Mon, 08 August 2005 19:13 Go to previous messageGo to next message
Billy Biggs is currently offline Billy BiggsFriend
Messages: 94
Registered: July 2009
Member
J Shannon wrote:
> Thanks for responding so quickly to my post...I tried your suggestion
> and I still cannot resize the columns to be smaller than their labels.
> Do you see anything in the code below that would be causing my problem?

Are you on Linux?

I think the default behaviour for GtkTreeView is that you can't
resize a column smaller than the size of the column's label.

-Billy
Re: Can the Column Width in a TableViewer to be smaller than the Column Text? [message #459405 is a reply to message #459402] Mon, 08 August 2005 19:49 Go to previous messageGo to next message
J. Shanonn is currently offline J. ShanonnFriend
Messages: 12
Registered: July 2009
Junior Member
Yes, I am on Linux.

Billy Biggs wrote:

> J Shannon wrote:
>> Thanks for responding so quickly to my post...I tried your suggestion
>> and I still cannot resize the columns to be smaller than their labels.
>> Do you see anything in the code below that would be causing my problem?

> Are you on Linux?

> I think the default behaviour for GtkTreeView is that you can't
> resize a column smaller than the size of the column's label.

> -Billy
Re: Can the Column Width in a TableViewer to be smaller than the Column Text? [message #459554 is a reply to message #459405] Wed, 10 August 2005 14:45 Go to previous message
Billy Biggs is currently offline Billy BiggsFriend
Messages: 94
Registered: July 2009
Member
J Shannon wrote:
> Yes, I am on Linux.

You should add yourself as a CC on this bug. I'm not sure if it's a
bug in SWT or not yet.

http://bugs.eclipse.org/bugs/show_bug.cgi?id=106381

-Billy
Previous Topic:basic cursor question
Next Topic:Inquiry on the status of OLE Excel bugs / work arounds
Goto Forum:
  


Current Time: Fri Apr 26 17:31:14 GMT 2024

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

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

Back to the top