Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » RowLayout: Does the marginRight mean margin on the right?
RowLayout: Does the marginRight mean margin on the right? [message #447884] Tue, 21 December 2004 08:04 Go to next message
cloudor Mising name is currently offline cloudor Mising nameFriend
Messages: 34
Registered: July 2009
Member
Hi,

Can anybody tell me why setting the marginRight value of RowLayout takes
no effect? Is this an swt bug?


Thanks,

cloudor
Re: RowLayout: Does the marginRight mean margin on the right? [message #447891 is a reply to message #447884] Tue, 21 December 2004 14:12 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
Works for me without wrap. When you pack the composite that has the
RowLayout or call computeSize on it, the right margin is added. If you are
just setting the size without querying the layout (e.g. shell.setSize(200,
200) then the right margin will have no effect.

Doesn't work when wrap is on and there controls have wrapped to more than
one row - this is a bug.

See:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=81730


public static void main (String [] args) {
Display display = new Display ();
Shell shell = new Shell (display);
RowLayout layout = new RowLayout();
layout.marginRight = 100;
//layout.wrap = true; // this fails when wrapping to more than one
row
shell.setLayout(layout);
Button b = new Button(shell, SWT.PUSH);
b.setText("button 1");
b = new Button(shell, SWT.PUSH);
b.setText("button 2");
b = new Button(shell, SWT.PUSH);
b.setText("button 3");
shell.pack();
shell.open ();
while (!shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
}

"Cloudor Pu" <cloudor@126.com> wrote in message
news:cq8lf0$7ls$1@www.eclipse.org...
> Hi,
>
> Can anybody tell me why setting the marginRight value of RowLayout takes
> no effect? Is this an swt bug?
>
>
> Thanks,
>
> cloudor
Previous Topic:Running SWTApp
Next Topic:Changing Mouse Cursor
Goto Forum:
  


Current Time: Sat Oct 24 21:31:57 GMT 2020

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

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

Back to the top