XWT: Preview & Run-time views are different [message #571697] |
Thu, 25 March 2010 01:25  |
Eclipse User |
|
|
|
Hi,
I have simple UI element, which has two button and a text widgets. The XWT designer and the Preview shows the button and text size (width and height) as I expected. But the run-time widget sizes are not shown as I defined. The default widget size is being shown.
Anyone has any idea, what is the correct way to define the widget width and height?
Demo.xwt
<Composite xmlns="http://www.eclipse.org/xwt/presentation"
xmlns:x="http://www.eclipse.org/xwt" xmlns:c="clr-namespace:demo.xwt"
xmlns:j="clr-namespace:java.lang" x:Class="demo.xwt.Demo">
<Composite.layout>
<GridLayout numColumns="2" />
</Composite.layout>
<Text x:style="SWT.NONE" weight="400" height="150" />
<Button x:style="SWT.PUSH" x:Name="NotifyButton1" text="Notify" width="200" Height="50" />
<Button x:style="SWT.PUSH" x:Name="NotifyButton2" text="Notify" width="200" Height="50" />
</Composite>
Demo.java
public class Demo extends Composite {
public Demo(Composite parent, int style) {
super(parent, style);
}
}
Simple main method:
public static void main(String[] args) {
URL content = Demo.class.getResource("Demo.xwt");
try {
XWT.open(content);
} catch (Exception e) {
e.printStackTrace();
}
}
|
|
|
|
|
Re: Preview & Run-time views are different [message #573427 is a reply to message #571697] |
Thu, 08 April 2010 03:16  |
Eclipse User |
|
|
|
How do you set the width and height, via XWT Visual Designer? If so, it
could be a bug of the tool and please report a bug.
Regards
Yves
"can kayacan" <kayacanc@hotmail.com> wrote in message
news:hoes53$hh2$1@build.eclipse.org...
> Hi,
>
> I have simple UI element, which has two button and a text widgets. The XWT
> designer and the Preview shows the button and text size (width and
> height) as I expected. But the run-time widget sizes are not shown as I
> defined. The default widget size is being shown.
>
> Anyone has any idea, what is the correct way to define the widget width
> and height?
>
> Demo.xwt
> <Composite xmlns="http://www.eclipse.org/xwt/presentation"
> xmlns:x="http://www.eclipse.org/xwt" xmlns:c="clr-namespace:demo.xwt"
> xmlns:j="clr-namespace:java.lang" x:Class="demo.xwt.Demo">
>
> <Composite.layout>
> <GridLayout numColumns="2" />
> </Composite.layout>
>
> <Text x:style="SWT.NONE" weight="400" height="150" />
>
> <Button x:style="SWT.PUSH" x:Name="NotifyButton1" text="Notify"
> width="200" Height="50" />
>
> <Button x:style="SWT.PUSH" x:Name="NotifyButton2" text="Notify"
> width="200" Height="50" />
>
> </Composite>
>
>
> Demo.java
> public class Demo extends Composite {
> public Demo(Composite parent, int style) {
> super(parent, style);
> }
>
> }
>
>
>
> Simple main method: public static void main(String[] args) {
> URL content = Demo.class.getResource("Demo.xwt");
> try {
> XWT.open(content);
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
|
|
|
Powered by
FUDForum. Page generated in 0.07685 seconds