| Setting dialog title [message #772387] |
Thu, 29 December 2011 11:44  |
Missing name Mising name Messages: 94 Registered: December 2010 |
Member |
|
|
Okay, I have a dialog that extends org.eclipse.jface.dialogs.Dialog
The constructor is:
public AccountDialog( Shell parent) {
super(parent);
setShellStyle(SWT.DIALOG_TRIM);
parent.setText("Create Account");
parent.setMinimumSize(300, 0);
return;
}
It's just that the setText() and setMinimumSize() don't seem to actually do anything.
The dialog has a blank titlebar, and the width is too small.
Dialog is just barely big enough for the OK/Cancel buttons, text entry fields are way too small. Dialog is a good width in the Window Designer, it's just a lot smaller when it actually runs.
|
|
|
| Re: Setting dialog title [message #774509 is a reply to message #772387] |
Tue, 03 January 2012 22:54   |
Duncan Krebs Messages: 31 Registered: June 2011 Location: Bay Area / Mexico |
Member |

|
|
I think if you try a different approach like this it might work: instead setting the text, and minimum size in the AccountDialog() constructor first create a new instance like this myAccountDlg = new AccountDialog(Display.getCurrent().getDisplay()); then you need to call first myAccountDlg.create() once you do that to set the dialog window text which I think you are trying to do you can call myAccountDlg.getShell().setText("Create Account") and do the same for setMinimuimSize() the key part is calling create() method first. Try that, hope it helps. - Duncan
[Updated on: Tue, 03 January 2012 22:55] Report message to a moderator
|
|
|
|
| Re: Setting dialog title [message #775420 is a reply to message #774511] |
Thu, 05 January 2012 19:04  |
Missing name Mising name Messages: 94 Registered: December 2010 |
Member |
|
|
Thanks, that let me do what I needed.
I really wanted to be able to set the title from within the Dialog code, and not require the caller to set it.
So I added this to my Dialog class, and it works!
public void create() {
super.create();
getShell().setText("Create Filter Group");
return;
}
|
|
|
Powered by
FUDForum. Page generated in 0.01840 seconds