setWidth for ToolItem in ToolBar does not function as expected [message #445450] |
Fri, 05 November 2004 22:26 |
Eclipse User |
|
|
|
Originally posted by: martin_hulth.hotmail.com
Background:
I have a vertical ToolBar with three items in it. I try to set the width
of all ToolItems equal to the maximum width using two for loops, and
they always revert back to the default minimum width.
Example:
Add an item to a toolbar and set the width, then print the width to test
if it was set...
// composite declared previously
....
ToolBar toolbar = new ToolBar (composite, SWT.VERTICAL);
ToolItem item = new ToolItem (toolbar , SWT.NONE);
addProtocolItem.setText ("Item");
addProtocolItem.setWidth(60);
System.out.println(addProtocolItem.getWidth());
....
This outputs "33" instead of "60". setWidth() does not behave as
expected. Any insight is appreciated.
Thank you.
Martin
|
|
|
Re: setWidth for ToolItem in ToolBar (code revised) [message #445451 is a reply to message #445450] |
Fri, 05 November 2004 22:42 |
Eclipse User |
|
|
|
Originally posted by: martin_hulth.hotmail.com
Martin Hulth wrote:
> Background:
>
> I have a vertical ToolBar with three items in it. I try to set the width
> of all ToolItems equal to the maximum width using two for loops, and
> they always revert back to the default minimum width.
>
>
> Example:
>
> Add an item to a toolbar and set the width, then print the width to test
> if it was set...
>
> // composite declared previously
> ...
> ...
> ToolBar toolbar = new ToolBar (composite, SWT.VERTICAL);
>
> ToolItem item = new ToolItem (toolbar, SWT.NONE);
> item.setText ("Item");
> item.setWidth(60);
> System.out.println(item.getWidth());
> ...
>
>
> This outputs "33" instead of "60". setWidth() does not behave as
> expected. Any insight is appreciated.
>
>
> Thank you.
>
> Martin
|
|
|
|
Powered by
FUDForum. Page generated in 0.04007 seconds