Xojo Modal Window

Seems on MacOS, even the Movable Modal still allows interaction with the main window. Is there a setting or something that allows for a true modal on MacOS? Seems to me a msgbox on MacOS is modal, so I think it must be possible?

Besides setting the window type to MovableModal to get node behavior you have to display the window using:


1 Like

For those of you who might be interested… Here is a peek as to why this is necessary… as Show, ShowModal and ShowModalWithin all react differently.

I recently created a NSWindow subclass (for use with Swift), and here is what I came up with for each of those functions…

    public final func show() {

	public final func showModal() {
		NSApp.runModal(for:self)  //<- this is the key difference

	public final func showModalWithin(_ parent:DSWindow?) {
		parent!.beginSheet(self, completionHandler: nil)

Thank you, Karen. If that’s in the docs I must have missed it!
Does that mean that any window can be made modal by launching it that way?

only “sort of”
while you can do that you might find they do not react as expected when you do that

1 Like