Weird menubar issue

  1. 7 months ago

    I just noticed that when I close the main window of my app by hitting the red close button, it closes, but if I go to the menubar and click anywhere, without even selecting any menuitem, it's triggering a new main window. I just can't seem to figure out how this is even possible. I have a New Window menuitem, but I don't even get to select it before the window opens. ??? Here is a quick video.

    link text

    I've been trying to comment out the code in some of the events such as open and close and some of the methods the window uses, but I can't seem to track down what might be causing this. Is there even an event that could trigger by clicking on the menubar?

  2. Dave S

    9 Oct 2018 San Diego, California USA

    If ANYTHING in your menu actions so much as refers to the window or any of its properties... the window will be reinstantiated (if you have "Implicit Instance" turned on (which is the default))

  3. thanks. I do have implicit instance turned on. I'll have to check the menu actions.

  4. so by putting any references to the main window into a method linked off the menuhandler, would that be enough to prevent the window from reinstantiating?

  5. Dave S

    10 Oct 2018 San Diego, California USA

    not really.... unless that keeps the reference from happening during the menu action.. its not the physical location... its where in the process flow it is.

  6. Edited 7 months ago

    many menu items are there to affect what's in the editor window. this was never a problem in earlier versions of XOJO, so I'm not sure how to go about solving this. I tried turning ImplicitInstance off and instead using

    dim w as EditorWin
    w = New EditorWin

    but it says it does not exist when I try to do anything with it like assign width.

or Sign Up to reply!