Modal dialog allows access to other windows?

My application has a user-facing main window, where most stuff happens. There is a separate “admin” window. This admin window is used to set up configuration files that are used by the main application. As such, there is some duplicate functionality, such as the controls that can move the connected external hardware. Only one of these windows should be allowed to do this at a time.

So I set the Admin window up as a Movable Modal, thinking that would block out access to the main window while it’s open. However, at least in the debugger, I can still modify the controls in the main window while the admin window is open. this is problematic, because you could potentially have two sets of hardware controls active at once, sending conflicting commands.

Is this a bug or limitation in the debugger, or do I need to explicitly disable/enable things in the main window every time the admin window is opened/closed?

I’m doing the bulk of the dev work on my mac, but the final application will run on Windows. Haven’t yet tested this code over there because it’s only partially done.

How do you display the window? ShowModal or ShowModalWithin? A simple Show doesn’t make it modal.

1 Like

I’m simply showing it from a menu item:

wAdminSetup.Show
Return True

Changing that to ShowModal does what I want.

The window’s type is set to Movable Modal in the Inspector - so is that only affecting the appearance of the window, and not the functionality?

Correct. If you want it to function as modal, you must use ShowModal. That controls the functionality.

1 Like