Label not Visible [message #77097] |
Thu, 06 March 2008 08:56  |
Eclipse User |
|
|
|
Originally posted by: me.micha-shl.de
Hey all,
I don`t know if it`s a bug or a 'feature'?!
I created my own Entrypoint, but in the first Version:
final Display display = new Display();
final Shell shell = new Shell(display);
shell.setSize(560, 420);
shell.setText("Shell Title");
shell.setLayout( new FillLayout());
final Label label = new Label(shell, SWT.CENTER);
label.setText("============= Start =================");
label.setVisible(true);
label.setEnabled(true);
shell.open();
...
the Label is not visible.
If I move the shell.setSize(560, 420) between the label.setEnabled(true)
and shell.open() the Label shows just fine.
Hope I don`t out me as an Newbie.
Regards
Michael
|
|
|
Re: Label not Visible [message #77111 is a reply to message #77097] |
Thu, 06 March 2008 10:30  |
Eclipse User |
|
|
|
Hi Michael,
Either you call shell.setSize() just before shell.open() or use
shell.pack() to trigger layouting. Otherwise the shell isn't layouted
and thats why your label isn't visible.
Regards,
Stefan.
Michael schrieb:
> Hey all,
>
> I don`t know if it`s a bug or a 'feature'?!
> I created my own Entrypoint, but in the first Version:
>
> final Display display = new Display();
> final Shell shell = new Shell(display);
> shell.setSize(560, 420);
> shell.setText("Shell Title");
>
> shell.setLayout( new FillLayout());
>
> final Label label = new Label(shell, SWT.CENTER);
> label.setText("============= Start =================");
> label.setVisible(true);
> label.setEnabled(true);
> shell.open(); ...
> the Label is not visible.
> If I move the shell.setSize(560, 420) between the label.setEnabled(true)
> and shell.open() the Label shows just fine.
>
> Hope I don`t out me as an Newbie.
>
> Regards Michael
|
|
|
Powered by
FUDForum. Page generated in 0.02713 seconds