|
|
|
|
|
Re: ToolBar in CoolBar [message #441620 is a reply to message #441568] |
Tue, 17 August 2004 15:29 |
Carolyn MacLeod Messages: 149 Registered: July 2009 |
Senior Member |
|
|
Interesting.
Yes, I think you should still open the bug report.
Mention that it only happens on QNX, and paste in your workaround.
I think it should be fixed to work no matter when the toolbar size is
calculated.
And while we wait for the fix, your bug report might help someone who may
have the same problem.
Thanks!
Carolyn
"Sergiy Uvarov" <colonel@rts-ukraine.com> wrote in message
news:cfsabu$h7t$1@eclipse.org...
> Carolyn MacLeod wrote:
> > Please open a bug report in Bugzilla against Platform - SWT.
> > Please make sure to specify that the problem occurs on QNX (Photon).
> > Thanks!
> > Carolyn
>
> More deep look at this problem have shown that problem occurs only if
> ToolBar size is calculated before putting it to CoolItem.
> So if you change snippet150 method "CoolItem createItem(CoolBar coolBar,
> int count)" like this then it works.
>
> static CoolItem createItem(CoolBar coolBar, int count) {
> ToolBar toolBar = new ToolBar(coolBar, SWT.FLAT);
> for (int i = 0; i < count; i++) {
> ToolItem item = new ToolItem(toolBar, SWT.PUSH);
> item.setText(itemCount++ +"");
> }
> CoolItem item = new CoolItem(coolBar, SWT.NONE);
> item.setControl(toolBar);
> toolBar.pack();
> Point size = toolBar.getSize();
> Point preferred = item.computeSize(size.x, size.y);
> item.setPreferredSize(preferred);
> return item;
> }
>
> And I am hesitating should I open a new bug?
>
> --
> Sergiy Uvarov
>
|
|
|
Powered by
FUDForum. Page generated in 0.03316 seconds