1 2 3 Previous Next 33 Replies Latest reply on Nov 16, 2016 11:48 PM by synergy46

    Hiding a Window

    synergy46

      In a script I have instructions to make  selected window to 'hide' mode.

       

      However, when this script is run in debug, it (line 11) simply makes the selected window (which is very small) blink off then on.

       

      What's up with that? 

       

      If I write a script with just steps 9 and 11 everything works as expected.  huh?

       

      Thanks for reading

      FMWindowOpen.png

      .... etc...

       

              end if

        • 1. Re: Hiding a Window
          keywords

          You could position the window off the screen, in which case you don't need the Hide Window step, since it will not be visible anyhow.

          • 2. Re: Hiding a Window
            synergy46

            As you can see in my code example, I previously had it that way.  But users

            'scroll' (in windows) to where it is and then are'confused' by it's

            presence ... go figure...

             

            The question is 'how do i make the window 'hidden'? And 'why doesnt the

            code work in this script but does work in a different script?? ?????

            • 3. Re: Hiding a Window
              dtcgnet

              During debugging, the window won't hide, as you're seeing. Try it with debugger off, and it should work properly, hiding the window as you intend.

              • 4. Re: Hiding a Window
                synergy46

                It doesn't make any difference whether I have debug on or off.  The (*&@(2 window will NOT 'hide'....grrrr

                 

                But if I run just steps 9 and 11 in it's own script it works.  Could the IF statement be the problem?

                 

                ideas?

                • 5. Re: Hiding a Window
                  synergy46

                  Here is a better, pictorial representation of what is going on.

                   

                  ResetWIndowScript.png

                   

                  I can run this in debug (shown above) and see that the Hide step is being executed.  Yet, running it out of Debug has the same result.

                   

                  I searched for additional information on Hide but FM doesn't provide much.

                   

                  I hope this clears things up...

                   

                  Ron

                  • 6. Re: Hiding a Window
                    planteg

                    Hi synergy46,

                     

                     

                    yes the if may fail, but could the Select Window may also fail ? One easy way to know if the script execute the if body, is to add the script step beep. You may add one after line 9 and 11, so if you hear 2 beeps, you are (almost) sure both steps execute.

                     

                    What OS are you running on and which version of FileMaker ?

                     

                    Hum, I am wondering if something else could fight with your script, like a script trigger or a timer on the window you wish to hide ?!?

                     

                    EDIT

                     

                    Got your last post once I send mine . So you're getting into the if body. So a script trigger / timer may be what you should look at. In either case, the debugger would show, if it's not a PSOS I guess.

                    • 7. Re: Hiding a Window
                      synergy46

                      I tried using beep and it confirms that the step is being executed.

                      There are no script triggers on the layout

                      I never set a timer on the window.

                      What is a PSOS?

                       

                      It bothers me that the same script without the IF works ok....  Why?

                       

                      R

                      • 8. Re: Hiding a Window
                        dtcgnet

                        What about trying a slightly different method?

                         

                        At the beginning of your script, add:

                        Set Error Capture [ On ]

                         

                        Instead of the If, use:

                         

                        Select Window [ Name: "Reset Lodge Setup" ; Current File ]

                        If [ Get ( LastError ) = 0 ] //The window was selected if there was no error

                        Adjust Window [ Hide ]

                        Else

                        Perform Script [ "Reset Lodge Setup 77 New" ]

                        End If

                        • 9. Re: Hiding a Window
                          synergy46

                          Sounds like a good idea.  I will try it.  If it works it sounds like a Filemaker BUG.

                           

                          For now:  I created a 2 line script called JunkerWindow

                           

                          junkerWindow.png

                          If I run this script it 'hides' the window.

                           

                          However, when, I substituted in the original script, running the JunkerWindow script above:

                           

                          ResetWIndowScript2.png

                           

                          This caused the original, 'Will not HIDE" window failure.

                           

                          What is That about?  A Filemaker bug?

                           

                          I am running:

                          WIndows 10

                          Filemaker 15 Advanced 15.0.2.220

                          • 10. Re: Hiding a Window
                            dtcgnet

                            By the way...does the Adjust Window [Hide] step give you an error? Or does it just refuse to hide the window?

                            • 11. Re: Hiding a Window
                              planteg

                              Yes, could be a bug. Can you try on Windows 7 ?

                               

                              Before calling JUNKERWINDOW, you already select the window. I wonder if disabling line 9 would give the same result.

                               

                              One other thing you may try is adding a delay between selecting the window and hiding it. If that works, then you have a workaround. Hope someone from FMC will chime in.

                              • 12. Re: Hiding a Window
                                synergy46

                                That is a great idea.

                                it seems to me if it is a bug FM would have a *LOT* of posts on the problem; they don't.

                                 

                                But, I use the same If structure elsewhere without a problem.   Perplexing

                                • 13. Re: Hiding a Window
                                  Vaughan

                                  Would the problem be that you hide the window that's currently active -- so it unhides? If you hide the window, what window do you want to become the active window?

                                   

                                  I'd suggest trying:

                                   

                                  change to another window

                                  hide the first window

                                  • 14. Re: Hiding a Window
                                    synergy46

                                    Huh?

                                    To hide the first window I have to specify it with a Select statement; right?

                                     

                                    Line 9 selects the Reset window

                                    Line 11 Hides it

                                     

                                    How would I change to another window (Membership) and hide the Reset window?  I am missing what you mean.

                                    1 2 3 Previous Next