What is a modal dialog? It's a window of some sort that does a minimum of 2 things:
1. Disallows input to anywhere else in the program until it is closed
2. Blocks program execution until closed.
I've by trying for hours to use combinations of the functions, "popup" "yield" and "Show modal" to get this to work.
This is as close as I can get:
my WindowDialog scene has a function called, "domodal" In this function I call popup() then call "yield(self, "popuphide")" I have a button in the scene that calls hide() Yes, the "Exclusive" checkbox is checked.
Else where in my program, I instance the MyWindowDialog, addchild() to put it in the tree and call domodal().
I would expect execution to stop at the yield function and resume when I hide the pop-up. What actually happens is that execution returns immediatley from the do_modal() function to where I had created and added the dialog - causing issues as the data that the dialog would create has yet to be created.
THe documentation indicates that the Yield function pauses execution, but this appears to not be the case. In fact the Yield function seems to return from the executing function to the next in the call stack, and allows re-entry to the called function from the yield function, at a later time point when the signal is met. Which causes the call stack to be executed and unwound twice.
So, Failing on requirement 2 of a modal.
Further... given that execution return... lets say I can detect that and skip the errors... The Dialog does show up, BUT it still allows input to the rest of the scene. I have the arrow keys mapped to moving the camera, and pressing the arrow keys while the dialog is up Still moves the camera despite Exclusive being checked and supposedly being 'modal'
So that fails requirement 1 of a modal.
Any ideas how to actually make a real live modal dialog?