Hello,
I have a problem with both FileDialog and DirectoryDialog
under Debian Lenny (GTK2) : when such dialog is closed (either when double
clicking an item, using select or cancel button, or simply closing it), the “open”
method returns with the expected result, but the shell remains open !
The shell is not repainted anymore, so it seems to
be “disposed”, but it’s still visible…
Moreover, if I open another file or directory
dialog, the previous one disappears!
Note that the parent shell is created with style “SWT.SYSTEM_MODAL | SWT.ON_TOP”
(and I’d like to keep this style…)
I tried with both SWT
3.4.2 and SWT 3.5.1…
Here is the code I’m using :
// The
following Shell is not made visible. We only show the file dialog.
final
Shell shell = new Shell(display, SWT.SYSTEM_MODAL | SWT.ON_TOP);
try {
final FileDialog fd = new FileDialog(shell, SWT.OPEN);
// ... Setting
of file dialog properties : text, filterPath, etc. ...
fd.open(); // Opens correctly, and return
normally, but the dialog remains open !
// Get the
correct result.
final String[] selectedFiles =
fd.getFileNames();
// ... Process the result ...
} finally {
// I tried to close the parent shell in a async runnable just in
case... But it doesn’t change anything.
display.asyncExec(new Runnable() {
@Override
public void run() {
shell.close();
shell.dispose();
}
});
}
I’m currently trying to remove “SWT.SYSTEM_MODAL | SWT.ON_TOP”
just to see if it changes something, but I really need the dialog to be
displayed on top and to block other running applications…
Any help is welcome! Thanks in advance!
Stephane