Problem with native Windows OpenDialog

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with native Windows OpenDialog

Karsten Kusche
Hi,

I just ran into a problem with the native Dialog for Windows that is
created when requesting a filename with the following code:

Dialog
        requestFileNameWithMessage: 'Open'
        default: '*.txt'
        version: #mustBeOld
        ifFail: ['']
        for: nil.

this opens a filerequest and this window is modal, just like it has to be.

If I call another Dialog right before that one, then this native dialog
is not modal, and in some cases also created behind all the other windows.
Try this code:

Dialog warn: 'You will see something wrong now:'.
Dialog
        requestFileNameWithMessage: 'Open'
        default: '*.txt'
        version: #mustBeOld
        ifFail: ['']
        for: nil.

Adding a Delay for some seconds between these two dialogs doesn't help, too.
When a different window is selected during the delay and that one is the
active window when the native dialog appears, then the native dialog is
modal again.

Dialog warn: 'You will see something wrong now:'.
(Delay forSeconds:6) wait.
Dialog
        requestFileNameWithMessage: 'Open'
        default: '*.txt'
        version: #mustBeOld
        ifFail: ['']
        for: nil.

Also stepping through the code with the debugger works fine.
Maybe someone has a solution for this bug.

Kind Regards
Karsten

Reply | Threaded
Open this post in threaded view
|

RE: Problem with native Windows OpenDialog

Boris Popov, DeepCove Labs (SNN)
I'd noticed this too, even with new FileDialog protocols (which Dialog falls
back to anyway in 7.4), and it seems to happen almost every second time
where native dialog would come up but stay behind all the VisualWorks
windows... Slightly confusing for some users.

Cheers!

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

-----Original Message-----
From: Karsten [mailto:[hidden email]]
Sent: Friday, May 05, 2006 9:25 AM
To: [hidden email]
Subject: Problem with native Windows OpenDialog

Hi,

I just ran into a problem with the native Dialog for Windows that is
created when requesting a filename with the following code:

Dialog
        requestFileNameWithMessage: 'Open'
        default: '*.txt'
        version: #mustBeOld
        ifFail: ['']
        for: nil.

this opens a filerequest and this window is modal, just like it has to be.

If I call another Dialog right before that one, then this native dialog
is not modal, and in some cases also created behind all the other windows.
Try this code:

Dialog warn: 'You will see something wrong now:'.
Dialog
        requestFileNameWithMessage: 'Open'
        default: '*.txt'
        version: #mustBeOld
        ifFail: ['']
        for: nil.

Adding a Delay for some seconds between these two dialogs doesn't help, too.
When a different window is selected during the delay and that one is the
active window when the native dialog appears, then the native dialog is
modal again.

Dialog warn: 'You will see something wrong now:'.
(Delay forSeconds:6) wait.
Dialog
        requestFileNameWithMessage: 'Open'
        default: '*.txt'
        version: #mustBeOld
        ifFail: ['']
        for: nil.

Also stepping through the code with the debugger works fine.
Maybe someone has a solution for this bug.

Kind Regards
Karsten


smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Problem with native Windows OpenDialog

Mark Pirogovsky-3
In reply to this post by Karsten Kusche


Karsten wrote:

> Hi,
>
> I just ran into a problem with the native Dialog for Windows that is
> created when requesting a filename with the following code:
>
> Dialog
>     requestFileNameWithMessage: 'Open'
>     default: '*.txt'
>     version: #mustBeOld
>     ifFail: ['']
>     for: nil.

It is not a bug, but the way modal windows are created in windows

The culprit here is the "for:nil" portion.  Give it a window  like

  Dialog
      requestFileNameWithMessage: 'Open'
      default: '*.txt'
      version: #mustBeOld
      ifFail: ['']
      for: myApplication builder window (or Dialog defaultParent)
.

and it is going to be modal- to the calling app window...

>
> this opens a filerequest and this window is modal, just like it has to be.
>
> If I call another Dialog right before that one, then this native dialog
> is not modal, and in some cases also created behind all the other windows.
> Try this code:
>
> Dialog warn: 'You will see something wrong now:'.
> Dialog
>     requestFileNameWithMessage: 'Open'
>     default: '*.txt'
>     version: #mustBeOld
>     ifFail: ['']
>     for: nil.
>
> Adding a Delay for some seconds between these two dialogs doesn't help,
> too.
> When a different window is selected during the delay and that one is the
> active window when the native dialog appears, then the native dialog is
> modal again.
>
> Dialog warn: 'You will see something wrong now:'.
> (Delay forSeconds:6) wait.
> Dialog
>     requestFileNameWithMessage: 'Open'
>     default: '*.txt'
>     version: #mustBeOld
>     ifFail: ['']
>     for: nil.
>
> Also stepping through the code with the debugger works fine.
> Maybe someone has a solution for this bug.
>
> Kind Regards
> Karsten
>
>
>

Reply | Threaded
Open this post in threaded view
|

RE: Problem with native Windows OpenDialog

Boris Popov, DeepCove Labs (SNN)
Mark,
 
The protocol you'd mentioned is obsolete in 7.4, so if that really is a culprit, it shouldn't be too hard to fix, should it? It seems a bit obscene to provide a window to something that really shouldn't need it or at least be able to deduce it without explicitly passing it in... It would be nice if one could just go 'OpenFileDialog open' and see the dialog in front of other windows.
 
Cheers!
 
-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.


From: Mark Pirogovsky
Sent: Fri 05/05/2006 6:41 PM
To: Karsten; [hidden email]
Subject: Re: Problem with native Windows OpenDialog

Karsten wrote:

> Hi,
> 
> I just ran into a problem with the native Dialog for Windows that is 
> created when requesting a filename with the following code:
> 
> Dialog
>     requestFileNameWithMessage: 'Open'
>     default: '*.txt'
>     version: #mustBeOld
>     ifFail: ['']
>     for: nil.

It is not a bug, but the way modal windows are created in windows

The culprit here is the "for:nil" portion.  Give it a window  like

  Dialog
      requestFileNameWithMessage: 'Open'
      default: '*.txt'
      version: #mustBeOld
      ifFail: ['']
      for: myApplication builder window (or Dialog defaultParent)
.

and it is going to be modal- to the calling app window...

> 
> this opens a filerequest and this window is modal, just like it has to be.
> 
> If I call another Dialog right before that one, then this native dialog 
> is not modal, and in some cases also created behind all the other windows.
> Try this code:
> 
> Dialog warn: 'You will see something wrong now:'.
> Dialog
>     requestFileNameWithMessage: 'Open'
>     default: '*.txt'
>     version: #mustBeOld
>     ifFail: ['']
>     for: nil.
> 
> Adding a Delay for some seconds between these two dialogs doesn't help, 
> too.
> When a different window is selected during the delay and that one is the 
> active window when the native dialog appears, then the native dialog is 
> modal again.
> 
> Dialog warn: 'You will see something wrong now:'.
> (Delay forSeconds:6) wait.
> Dialog
>     requestFileNameWithMessage: 'Open'
>     default: '*.txt'
>     version: #mustBeOld
>     ifFail: ['']
>     for: nil.
> 
> Also stepping through the code with the debugger works fine.
> Maybe someone has a solution for this bug.
> 
> Kind Regards
> Karsten
> 
> 
>