[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [platform-swt-dev] SWT Directory Dialog - No response yet
|
I ran the following code on Windows 2000 and Windows XP and it worked just
fine for me. Does it work for you?
If not, please enter a bug report against Platform SWT and provide some
details of your configuration.
It it does work, can you modify this example to make it fail in the way
you are seeing?
Note that if the folder "C:\\BaseLocation" does ot exist, the dialog will open on the default directory.
public class Main {
public static void main(String[] args) {
Display display = new Display();
final Shell shell = new Shell(display);
Button b = new Button(shell, SWT.PUSH);
b.setText("b");
b.setBounds(10, 10, 100, 40);
b.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
Composite parentComp = (Composite)
((Button) e.getSource()).getParent();
Button b = (Button)e.widget;
DirectoryDialog locnDir = new DirectoryDialog(b.getShell(), SWT.OPEN);
locnDir.setFilterPath("C:\\BaseLocation");
System.out.println(locnDir.open());
}
});
shell.pack();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
}
"Kapasi, Mehjabin" <mkapasi@xxxxxxxxxxxx>
Sent by: platform-swt-dev-admin@xxxxxxxxxxx
02/27/2003 11:25 AM
Please respond to platform-swt-dev
To: "'platform-swt-dev@xxxxxxxxxxx'" <platform-swt-dev@xxxxxxxxxxx>
cc:
Subject: RE: [platform-swt-dev] SWT Directory Dialog - No response yet
Hello,
I'd posted this message a while ago. I am hoping to get some info on this.
One additional thing I noticed is that this error does not happen on
Windows
XP but only on Windows 2000!
Any clues?
Thanks in advance for your help,
-Mehjabin
-----Original Message-----
From: Kapasi, Mehjabin
Sent: Friday, February 21, 2003 9:35 AM
To: 'platform-swt-dev@xxxxxxxxxxx'
Subject: RE: [platform-swt-dev] SWT Directory Dialog
Here is the code:
On clicking a browse button in the dialog this dir dialog comes up. This
code is in the widgetSelected() method of the listener.
Composite parentComp = (Composite)((Button)e.getSource()).getParent();
DirectoryDialog locnDir = new
DirectoryDialog(parentComp.getShell(),SWT.OPEN);
locnDir.setFilterPath("C:\\BaseLocation");
String locn = locnDir.open();
While passing the shell I also tried doing
Display.getCurrent().getActiveShell(),
I also passed in null,
I also tried creating a new shell : Shell newShell = new Shell() and then
passing newShell into the Directory Dialog constructor.
None of these would get the pane to show up.
I've also attached the snapshot of what it looks like.
Thanks in advance for all your help.
-Mehjabin
-----Original Message-----
From: Veronika_Irvine@xxxxxxxxxx [mailto:Veronika_Irvine@xxxxxxxxxx]
Sent: Friday, February 21, 2003 6:51 AM
To: platform-swt-dev@xxxxxxxxxxx
Subject: Re: [platform-swt-dev] SWT Directory Dialog
Can you post some code showing how you use DirectoryDialog?
"Kapasi, Mehjabin" <mkapasi@xxxxxxxxxxxx>
Sent by: platform-swt-dev-admin@xxxxxxxxxxx
02/20/2003 06:13 PM
Please respond to platform-swt-dev
To: "'platform-swt-dev@xxxxxxxxxxx'"
<platform-swt-dev@xxxxxxxxxxx>
cc:
Subject: [platform-swt-dev] SWT Directory Dialog
When using the SWT Directory Dialog in a small tester class with the
default
Shell, the dialog shows up correctly. When I plugged that into my
application, the pane in the dialog that allows the selection of directory
shows up blank. The only thing I see in the dialog is a blank pane
followed
by the path and OK button at the bottom. I am not able to see the
directory
tree.
I have a hunch this might have to do with the shell being passed into the
constructor of the directory dialog. I checked and it is not null.
Any suggestions on how I can get the directory dialog to show up
correctly?
Thanks,
-Mehjabin
_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-swt-dev
_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-swt-dev