XWT: Preview & Run-time views are different [message #523100] |
Thu, 25 March 2010 05:25 |
can kayacan Messages: 16 Registered: March 2010 |
Junior Member |
|
|
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 as I expected. But the run-time widget sizes are not shown as I defined. The default widget size is being shown instead.
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="1" />
</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();
}
}
[Updated on: Thu, 25 March 2010 05:28] Report message to a moderator
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03508 seconds