FileClose closes the wrong window

  1. 9 months ago

    Arthur G

    10 Mar 2018 Pre-Release Testers

    Sorry if I am not putting this clearly but I hope I get the necessary details here.
    I have several document type windows (all are .Show and not .ShowModal) that I open and closing with a menuItem Fileclose works fine usually.
    I have Mainwindow that can open the Prefwindow. I also have the StrtUpPrefs, which will (re)sets which Ini file is used.
    The Mainwindow has one menubar, while the other 2 use a smaller version.

    The StrtUpPrefs is the first window, but if one wants to reset the Ini then what happens is

    1. Open the PrefWindow and press a button that opens the StrtUpPrefs window. (This action also closes the MainWindow).
    2. Reset the Ini file.
    3. Close the window - which should make the PrefWindow active and verify the Ini. Code is Self.Close for close.

    The FileClose works correctly with StrtUpPrefs the first time.
    What I know is happening on the 2nd time around with the FileClose is the StrtUpPrefs menu EnableMenuItems is not firing when it is opening.
    It is firing when it was the only window.

    Also, when this goes wrong, StrtUpPrefs is Window(0).

    I know enough (I hope) to be sure I cannot make EnableMenuItems fire.
    What am I missing?

    I solved my problem with 2 things.

    I had replaced in the menu item shortcut a capital W, because I had seen shown the lower case letters in the compiled app. The capital W started it going to the wrong window, and I changed it back to a small w. Now it worked.

    The other change is in the button which opened the StrtUpPrefs.Action had 2 lines of code.

    StrtUpPrefs.show
    MainList.close

    The last line was supposed to (and did) close the main window while finishing the button's action items. For some reason, it was waiting until the window StrtUpPrefs actually closed.
    So I moved that line to StrtUpPrefs.Open and it all worked like it was supposed to.

  2. Tim H

    10 Mar 2018 Pre-Release Testers Portland, OR USA

    What is the frame type of StrtUpPrefs?

  3. Arthur G

    10 Mar 2018 Pre-Release Testers

    All 3 are document frame and not modal. Unless I'm missing something

  4. Arthur G

    10 Mar 2018 Pre-Release Testers

    Double checked. My only modals are dialogs

  5. Arthur G

    12 Mar 2018 Pre-Release Testers Answer
    Edited 9 months ago

    I solved my problem with 2 things.

    I had replaced in the menu item shortcut a capital W, because I had seen shown the lower case letters in the compiled app. The capital W started it going to the wrong window, and I changed it back to a small w. Now it worked.

    The other change is in the button which opened the StrtUpPrefs.Action had 2 lines of code.

    StrtUpPrefs.show
    MainList.close

    The last line was supposed to (and did) close the main window while finishing the button's action items. For some reason, it was waiting until the window StrtUpPrefs actually closed.
    So I moved that line to StrtUpPrefs.Open and it all worked like it was supposed to.

or Sign Up to reply!