Intercept the Quit

  1. last week

    Jaap C

    Sep 12 Pre-Release Testers, Xojo Pro Europe, Holland

    I don't know anymore :-(

    My (macos) app has 1 window and cannot be closed.
    How can I intercept the action done by Quit in the menubar?

    Put a Msgbox in the CANCELCLOSE? if they say "no" then you can cancel.....

  2. Dave S

    Sep 12 San Diego, California USA

    In the CLOSE event?

    If your window "can't be closed", be sure to check that the close process does not refer to the window or any of its methods or properites, as those will reinstantiate the window again

  3. Jaap C

    Sep 12 Pre-Release Testers, Xojo Pro Europe, Holland

    Yeah in the app.close event, but I cannot cancel the quit or ask if the user really want to quit!

  4. Dave S

    Sep 12 Answer San Diego, California USA

    Put a Msgbox in the CANCELCLOSE? if they say "no" then you can cancel.....

  5. Jaap C

    Sep 12 Pre-Release Testers, Xojo Pro Europe, Holland

    I never used the CancelClose but that's prior to the real Close event!

  6. Dave S

    Sep 12 San Diego, California USA

    Yes it is Prior to the close event.... it detemines if you wish to CANCEL the close (hence the name)

    Perhaps, reading the LR might help?

  7. Tim J

    Sep 12 Pre-Release Testers, Xojo Pro Dehydrating in AZ

    @Dave S Perhaps, reading the LR might help?

    It would if Xojo provided a call tree diagram that outlined the call order of events ... ;) I remember a fogbugz request for this back in the 05/6 timeframe, but I don't see it in Feedback.

  8. Roger C

    Sep 12 Lewis Center, OH

    outlined the call order of events

    I have been with RB/RS/Xojo since 2000. The answer to that has always been "Do not rely on the order of events. It may change at any time."

  9. Dave S

    Sep 12 San Diego, California USA

    @Roger C I have been with RB/RS/Xojo since 2000. The answer to that has always been "Do not rely on the order of events. It may change at any time."

    In some cases that is true... but CANCELCLOSE will always occur before CLOSE.... since one inititates the other.

  10. Tim S

    Sep 13 Canterbury, UK

    @Roger C I have been with RB/RS/Xojo since 2000. The answer to that has always been "Do not rely on the order of events. It may change at any time."

    Is this a general statement, or just describing what happens in this particular situation.

    I find it disappointing that there is not a proper documentation section describing the detail of the Xojo event model, as there is for the HTML DOM.

  11. Roger C

    Sep 13 Lewis Center, OH

    A quick search of the Forum yields many examples of this statement. I.e. see Norman’s reply in this thread.
    https://forum.xojo.com/35030-order-of-events

or Sign Up to reply!