Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » ViewForm Issue
ViewForm Issue [message #464341] Mon, 21 November 2005 18:23 Go to next message
Jeff Yuan is currently offline Jeff YuanFriend
Messages: 34
Registered: July 2009
Member
Hi,
Sorry for the barrage of questions, but I've gotten a lot of great help
here.

But for a ViewForm, I am having some problems. Can you set a Composite to
the
setTopLeft(Control c) method? I am interested in setting a few Labels in
a Composite, and setting that to the TopLeft of the ViewForm as a sort of
Header, but the composite is not visible when I set it. Is this something
to do with the ViewForm or is it some subtlety with the Composite?

Thanks.
Re: ViewForm Issue [message #464389 is a reply to message #464341] Tue, 22 November 2005 18:11 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
The following works for me:

public static void main (String [] args) {
Display display = new Display ();
Shell shell = new Shell (display);
shell.setLayout(new FillLayout());
ViewForm vf = new ViewForm(shell, SWT.BORDER);
Composite c1 = new Composite(vf, SWT.NONE);
c1.setLayout(new RowLayout());
Label l = new Label(c1, SWT.BORDER);
l.setText("label 1");
l = new Label(c1, SWT.BORDER);
l.setText("label 2");
vf.setTopLeft(c1);
l = new Label(vf, SWT.BORDER);
l.setText("Content");
vf.setContent(l);
shell.open ();
while (!shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
}

"zinc" <zincsterio@yahoo.com> wrote in message
news:df42ef3e3eb7b8c58d941c9c8ae2630d$1@www.eclipse.org...
> Hi,
> Sorry for the barrage of questions, but I've gotten a lot of great help
> here.
>
> But for a ViewForm, I am having some problems. Can you set a Composite to
> the
> setTopLeft(Control c) method? I am interested in setting a few Labels in
> a Composite, and setting that to the TopLeft of the ViewForm as a sort of
> Header, but the composite is not visible when I set it. Is this something
> to do with the ViewForm or is it some subtlety with the Composite?
>
> Thanks.
>
Previous Topic:Change and recompile SWT
Next Topic:Why isn't the Browser control supported on Solaris (Sparc/X86) or HPUX
Goto Forum:
  


Current Time: Fri Aug 23 05:08:41 GMT 2019

Powered by FUDForum. Page generated in 0.01882 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top