BlockFlow width [message #215665] |
Mon, 08 May 2006 14:30 |
Eclipse User |
|
|
|
Originally posted by: dana.schoonover.wpafb.af.mil
How can I determine the width of blockFlow?
TextFlow textFlow = new TextFlow ("Send Order");
BlockFlow blockFlow = new BlockFlow();
blockFlow.setOrientation(SWT.LEFT_TO_RIGHT);
blockFlow.setHorizontalAligment(PositionConstants.LEFT);
blockFlow.setBorder(SimpleEtchedBorder.singleton);
blockFlow.add(textFlow);
The following methods all seem to yield zero values:
dimension = blockFlow.getSize();
System.out.println("dimension.width = " + Integer.toString
(dimension.width));
dimension = blockFlow.getPreferredSize();
System.out.println("getPreferredSize = " +
Integer.toString(dimension.width));
|
|
|
Re: BlockFlow width [message #215673 is a reply to message #215665] |
Mon, 08 May 2006 17:03 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
This is because layout does not occur immediately. If it did, we would have
layed out 4 times. You need to force the update manager to run.
Normally this is not necessary. You should be querying the size/position
withing the context of a layout, in which case the block would already have
been positioned. Or, you add a listener to the figure to follow it, etc.
"Dana Schoonover" <dana.schoonover@wpafb.af.mil> wrote in message
news:91292d29d02f115beccf6a03b9daf1c0$1@www.eclipse.org...
>
> How can I determine the width of blockFlow?
>
> TextFlow textFlow = new TextFlow ("Send Order");
> BlockFlow blockFlow = new BlockFlow();
> blockFlow.setOrientation(SWT.LEFT_TO_RIGHT);
> blockFlow.setHorizontalAligment(PositionConstants.LEFT);
> blockFlow.setBorder(SimpleEtchedBorder.singleton);
> blockFlow.add(textFlow);
>
> The following methods all seem to yield zero values:
>
> dimension = blockFlow.getSize();
> System.out.println("dimension.width = " + Integer.toString
> (dimension.width));
> dimension = blockFlow.getPreferredSize();
> System.out.println("getPreferredSize = " +
> Integer.toString(dimension.width));
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02677 seconds