Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Size trouble with dialog box
Size trouble with dialog box [message #450307] Thu, 10 February 2005 10:40 Go to next message
Eclipse UserFriend
Originally posted by: ssc.acentic.net

Hi

I try now for several hours to get a dialogbox to work in the size
I set it, but it does always set its size to what ever.

I do this and I expect to have a DialogBox at 500x220 but it
only shows up as a small box:

public class AboutDialog {

private Shell parent;
private Shell dialog;

public AboutDialog (Shell shell) {
super();
parent = shell;
}


public boolean open () {
final boolean[] value = new boolean[1];

final Shell dialog = new Shell(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);

dialog.setLayout(new FillLayout());

dialog.setSize(500, 220);
dialog.setLocation(GUI.getCenter(dialog));
dialog.pack();
dialog.open();

while (!dialog.isDisposed()) {
if (!GUI.display.readAndDispatch())
GUI.display.sleep();
}

return value[0];
}
}

Hope someone can help me out here,

Thanks, Sebastian
Re: Size trouble with dialog box [message #450335 is a reply to message #450307] Thu, 10 February 2005 11:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ssc.acentic.net

took a while but adding dialog.setMinimumSize(500, 220); did the trick ;)
Re: Size trouble with dialog box [message #450341 is a reply to message #450335] Thu, 10 February 2005 14:16 Go to previous message
Stef van Dijk is currently offline Stef van DijkFriend
Messages: 31
Registered: July 2009
Member
"Sebastian Scholz" <ssc@acentic.net> wrote in message
news:pan.2005.02.10.11.28.09.110000@acentic.net...
> took a while but adding dialog.setMinimumSize(500, 220); did the trick ;)

Well, that's one way to resolve it. I think your "problem" was that after
setting the size, you told the dialog to pack().

Stef
Previous Topic:DSOFramer ActiveX and SWT - SWTOleSample.java (0/1)
Next Topic:Showing a table properly after the input has changed.
Goto Forum:
  


Current Time: Fri Apr 26 14:48:49 GMT 2024

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

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

Back to the top