1 2 Previous Next 24 Replies Latest reply on May 4, 2015 10:25 AM by erolst

    Opening hidden windows

    marcodezordo

      Bet this has been discussed here before, but can't find any reference. I often open new "hidden" windows for working on other tables or records without affecting the frontmost window. I know this has performance impact, but find situations where the pros definitely outnumber the cons.

      Prior to FM 12 I used to open those windows with a Distance From Top = Get ( ScreenHeight ). When upgrading to FM 12 (I think, but could be wrong) we started to have problems on some Windows pc, with windows showing up when they weren't supposed to. We tried negative numbers for the Distance From Top, and finally switched to Top = 5000. Which I do not like.

       

      Is there a "best practice" in hiding windows?

       

      Btw, to set the Distance From Top I use a custom function that tests a global variable (like $$debug) and returns either 5,000 (or the ScreenHeight or whatever) or - if $$debug is true - Get (WindowTop ) + 40.

        • 1. Re: Opening hidden windows
          jcooper

          I usually just put it into negative space.  I use an Open Hidden Window script through, that either puts it off screen or, the logged in with full access, in the top-left corner so I can see what's happening when troubleshooting. I also have the script return the name of the window (which is a random string) so I can reference it to select, close, move, whatever.

           

          We're on Mac though and I think negative-space windows make things ugly in Windows, because of the whole windows-inside-of-windows thing, but I could be wrong.

           

          Thanks,

           

          Jeff

          • 2. Re: Opening hidden windows
            siplus

            opening a window of 100 x 100 pixels at -200; -200 works perfectly on the Mac. No need to calculate coordinates, you just hardwire that. But you already knew it, I guess. Of course, on Windows... "My God, it's full of stars!" and on the Mac you do see an unpleasant effect (current window does not throw a shadow while the hidden window exists).

             

            The best way to hide windows in which you do witchcraft is not having to make them appear at all, and your best friend to deal with this is Perform Script on Server. Investigate it.

             

            Also: If you open the offscreen window to create records, you can avoid doing it by using the Magic Key technique.

             

            We can be more specific if we get to know what you're using your hidden windows for.

            • 3. Re: Opening hidden windows
              Benjamin Fehr

              opening a window of 100 x 100 pixels at -200; -200 works perfectly on the Mac.

              I use 20x20px at -~200; 0. No problems on Win either. Though this pops up left from main monitor. Most user have external monitor on the right side

               

              Also: If you open the offscreen window to create records, you can avoid doing it by using the Magic Key technique.

              We can be more specific if we get to know what you're using your hidden windows for.

              Please! Would like to know more …

              • 5. Re: Opening hidden windows

                You can work with a hidden window, and I refer to a hidden window and not an off screen window, go to layout, new records, etc.

                 

                I ran a test to see if

                New Window

                Hide Window

                Go TO Layou

                New Record

                Set field

                commit record

                 

                Would work as a hidden window. It did quite nicely. No off screen coordinates were used. When I selected the hidden window, the new records were visible.

                 

                One problem is with triggers. So I tried with just a blank layout, no triggers. Worked fine.

                 

                I then tried making a new window in the same script, ie making a new window from a hidden window. It worked. Every new window I made while a hidden window had the focus remained hidden.

                 

                So, if triggers aren't an issue, you can do a lot of work with just hidden windows. Your user won't notice since New Window is not really a New Empty Window it is a Duplicate Window, hence the trigger issues.

                 

                So, a hidden window is the frontmost window just as one way off screen would be.

                 

                Another option...

                • 6. Re: Opening hidden windows
                  Fred(CH)

                  I personally used it for a while, and it is true it worked quite fine. Just two remarks :

                   

                  1. If you create more than one hidden windows, be mindful about stack, because hidden windows are not a part of it. Thus, when you close a hidden window, then the most front VISIBLE windows is selected, even if the last windows created/selected was hidden; so you may have to use the Select window step.
                  2. I could always see a flash which was not so pretty. But it may be due, as you pointed out, because my layout/window wasn't blank. Of course they are numerous other possible performance factors.

                   

                  I actually do a -5000 from top (when not alt key and Full access condition for debugging purposes), and name my windows with Get(scriptName) with an eventual "1", "2" etc… that reflects the stack order.

                   

                  And i will follow Siplus links with attention this week-end…

                   

                  Fred

                   

                  Edit : And as a side note, i must admit that most of the time, i use off-screen windows as a simple "found set memory".

                  • 7. Re: Opening hidden windows
                    dsvail

                    been using  in the window dialog ....  Top = Get ( WindowDesktopHeight ); Left = Get (WindowDestopWidth)

                    • 8. Re: Opening hidden windows
                      marcodezordo

                      Jack, thanks for the suggestion: never thought about it. I'm testing your approach, but I see the new window flashing on screen - not always but often. Always, if you use it in a "GTRR-New Window" scenario, since the new window is different from the original one and you can see its contents before the Hide command.

                       

                      What is interesting is that the debugger automatically shows the hidden window - no need for testing Full Access or ActiveModifierKeys. But I find a bit scaring that the hidden window is NOT - at least apparently - the frontmost window, even if it remains the target of the script.


                      One final thought: I found at least one step (Pause/Resume) that, when executed by a script, immediately unhide the hidden window. I admit that you'll probably never use it in this scenario, but wonder if other commands share the same behavior.

                      • 9. Re: Opening hidden windows

                        FileMaker is still years behind other db apps when it comes to window controls and multi-tasking.

                         

                        In 1990 or so I could open a dozen different windows in 4D and start a process running in each as unique processes, even if it was the same script. 4D used time slicing to share the processor. Wonder what it does now with quad processors?

                         

                        So, you want to do a daily billing, run it in Window 1 while doing something else in Window 2.

                         

                        Sometimes I really miss it. If it wasn't for FileMaker Go....

                        • 10. Re: Opening hidden windows

                          A 'new' window is a duplicate of an existing window in all of its characteristics.

                           

                          So, for GTTR instead of gttr new window do new window then hide then gttr without a new window. Same thing.

                          • 11. Re: Opening hidden windows
                            Fred(CH)

                            marcodezordo a écrit:

                             

                            But I find a bit scaring that the hidden window is NOT - at least apparently - the frontmost window, even if it remains the target of the script.

                             

                            Exactly what i explained in my in the upper post :

                             

                             

                             

                            1. If you create more than one hidden windows, be mindful about stack, because hidden windows are not a part of it. Thus, when you close a hidden window, then the most front VISIBLE windows is selected, even if the last windows created/selected was hidden; so you may have to use the Select window step.
                            • 12. Re: Opening hidden windows
                              Fred(CH)

                              Same opinion here. Worked fifteen years closely with 4D delevopers (as tester, TS), and learned a bit of language.

                               

                              You pointed one of most important PROS for 4D to me. But When i decided to let that enterprise to became free lance FileMaker developer full time, it was also because i was previoulsy impressed by FMP (9) and the number of its PROS, against the only real reference i had : 4D (2004 i think).

                               

                              To return back to the main topic, what could really help here is the "new" Perform script on server step, which you also had in 4D since… hum, very long time .

                               

                              Fred

                              • 13. Re: Opening hidden windows
                                marcodezordo

                                Just a quick reply: I think Perform script on server is not an option for my main project: 120 concurrent clients... the server is already busy enough... ;-)

                                 

                                Or am I wrong?

                                • 14. Re: Opening hidden windows
                                  siplus

                                  you are wrong.

                                  1 2 Previous Next