[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.platform.swt] Re: Table width and scroll bars
|
It could be an swt bug since the horizontal scrollbar should not appear
unless it's actually needed, but this must not be the case if subsequently
making the view smaller makes the scrollbar go away. I can't get a simple
case to do this on win2000 though, so it may be context-specific (or you're
on a different platform?) (or you're on an older swt?). Are you able to
make this happen in the snippet below (the Table auto-resizes to always fill
the Shell)? And if not, can the snippet show it by changing its Table to
more closely resemble yours?
public static void main(String[] args) {
final Display display = new Display();
final Shell shell = new Shell(display);
shell.setBounds(10,10,200,200);
shell.setLayout(new FillLayout());
final Table table = new Table(shell, SWT.NONE);
for (int i = 0; i < 5; i++) {
new TableItem(table, SWT.NONE).setText("item asfdas asdf asdfasd " +
i);
}
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) display.sleep();
}
display.dispose();
}
Grant
"Brian" <nebulour@xxxxxxxxx> wrote in message
news:1066ed3ff6428bf07b24076a671f935a$1@xxxxxxxxxxxxxxxxxx
> Hopefully this is an easy one. I have a table and due to the initial size
> of the View, it starts out with only displaying about 10 rows. During
> normal processing, if I put 10 or less rows on the table, everything is
> fine. When I put more than 10, it requires a vertical scroll bar. When
> the vertical scroll bar is added it takes up part of the table width and a
> horizontal scroll bar is added. If I barely resize the View (either
> larger or smaller), the horizontal scroll bar disappears and I can still
> see all the table data fine.
>
> Is there something I can do, possibly a resize event, so that the
> horizontal scroll bar does not appear when it really doesn't need to be
> there (just because a horizontal scroll bar was added)?
>
> Thanks.
>