Jump to content

Modal, but asyncronously called dialog


Recommended Posts

Posted (edited)

In various part of my application I want to allow users to open a setup dialog and when that setup dialog is open they should not be able to  shift to another window, so the dialog should be modal...

However, I also want the callers to continue to update as the user might then discover something critical in those displays while in the setup and exit the setup. The easy (/correct) solution to this is to have a separate loop in the callers that calls these setup dialogs, because then the setup dialog can be called statically/syncronously and have its window set to modal....I then get both updates in the caller's display and block access to GUI operations in the caller window. Now the downside to that is that you have to have such a dedicated loop and for various reasons some of the updates happen in the same loop here, so instead I thought I could call the dialog dynamically. This invalidates the modal behaviour though as it will not be modal in relation to the caller anymore.

Setting the dialog "Always on top" is one option, but then it will stay on top even of file dialogs it calls(!) so unless you turn off the always on top setting every time you call a file dialog you have another problem. Setting the dialog to floating on the other hand does not block access to the caller's window. I can alternatively live with that by adding code to close the dialog if the parent gets closed etc, but a true modal behaviour would remove the need for such additional code and would be preferable.

So, the question is, is there a way to call a VI asyncronously, but still force it to behave modal in relation to its caller (or "globally" (for the application))? Or should I just capitulate and make sure these calls happen statically in a loop that can wait?

Edited by Mads
Posted (edited)

Well, it seems to be sufficient to set the dialog to modal *and* set its front panel to frontmost. As long as it is both the VI stays modal and blocks access to all other windows.

Edited by Mads

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.