Nested ShowModal calls

I’m busy converting a large Xojo app from Carbon to Cocoa (it’s cross-platform, so some Windows issues too). In some of my modal dialogs I have a button (say “Additional Settings…”) which opens a further modal dialog via ShowModal(). Now, I know this is against what a modal dialog is defined to do, but it worked fine on Windows and Mac Carbon. It also works “fine” on Cocoa, but the second dialog opens with a beep sound.

Any suggestions of how to lose the beep sound? That is apart from redesigning my dialogs, using sheets, etc.

Redesign your dialogs.

Thanks,
All of your users.

Another way would be to place all the controls you had previously on a second window, on the right hand side of the first modal window, hidden from the user because off view.

So when the user clicks, it simply increases the width of the window, to show the additional settings. And when finished, reduce the size again.

That way you are using only one modal window.

Add a PagePanel to the modal window and move through the panels.

[quote=298250:@Paul Rodman]I’m busy converting a large Xojo app from Carbon to Cocoa (it’s cross-platform, so some Windows issues too). In some of my modal dialogs I have a button (say “Additional Settings…”) which opens a further modal dialog via ShowModal(). Now, I know this is against what a modal dialog is defined to do, but it worked fine on Windows and Mac Carbon. It also works “fine” on Cocoa, but the second dialog opens with a beep sound.

Any suggestions of how to lose the beep sound? That is apart from redesigning my dialogs, using sheets, etc.[/quote]

This sounds like it should work. Do your windows have their frame type set correctly?

OK, I ascertained that the beep isn’t occurring in ShowModal, it’s occurring when I create the nested dialog. i.e. this line:

dim dlg as new WhateverDialog

The parent and nested dialog window frames are both Movable Modal.

I really don’t want to redesign all this stuff right now.

…or tell my users to turn off sound :^)

I also tried hiding the parent dialog window before creating the nested one - to no avail.

Actually, wait a minute. I just created a test app and it works fine (no beep). There’s more to this than meets the eye. Perhaps it’s left-over project crap from the old Carbon version somehow causing a bad interaction with 2016r3.

Never mind. Problem solved. I was changing the Default state on buttons in the Open event (effectively). I suspect that is too early in “nested” dialogs. Putting that code in a 1 msec timer resolves the issue.

I switched other Sheet windows from previous 2nd .showmodal windows (nested from within other Sheet windows)
to Movable Modal windows for now, but the Pagepanel method mentioned by Markus W. *) is also a good idea.

Close it first, not just hiding. :slight_smile:

*) if not logged in, you’ll see the “W.” only.