• Login
sketchucation logo sketchucation
  • Login
πŸ”Œ Quick Selection | Try Didier Bur's reworked classic extension that supercharges selections in SketchUp Download

Webdialog position not preserved across session on MAC

Scheduled Pinned Locked Moved Developers' Forum
18 Posts 8 Posters 2.6k Views 8 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    fredo6
    last edited by 8 Nov 2010, 22:20

    on MAC, it seems that the position of web dialog are not saved across SU sessions, whatever you put in the regkey parameter (the 3rd one in the new method).

    Am I the only one to notice this?

    Fredo

    1 Reply Last reply Reply Quote 0
    • T Offline
      thomthom
      last edited by 9 Nov 2010, 08:29

      Haven't checked it out, but on PC the position is stored between sessions, but not within sessions. If you make a webdialog, close it, then open it again it doesn't remember the last position - only the last position from last session.

      Thomas Thomassen β€” SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund

      1 Reply Last reply Reply Quote 0
      • T Offline
        tomasz
        last edited by 9 Nov 2010, 10:32

        I confirm that on Mac WebDialog position is not being stored.

        Author of [Thea Render for SketchUp](http://www.thearender.com/sketchup)

        1 Reply Last reply Reply Quote 0
        • J Offline
          Jim
          last edited by 9 Nov 2010, 14:05

          @thomthom said:

          on PC the position is stored between sessions, but not within sessions.

          All my (Windows) webdialogs re-open where I close them, same session and between sessions (unless SU is closed by a BugSplat.)

          Hi

          1 Reply Last reply Reply Quote 0
          • J Offline
            jeff hammond
            last edited by 9 Nov 2010, 14:23

            yeah, you're correct in your findings.. (and this isn't the case in other mac apps that i use)

            component options & attributes will not remember their position or wether or not they are open/closed (those are web dialogs right ? πŸ˜„)
            many of the other windows will remember their position and open/close status (entity info etc.) but i don't think they're web dialogs?
            the ruby console is a mix of the two.. it will keep it's position but won't stay open. (but it's using a different template than the component attributes - one looks like cocoa and the other carbon?)

            dotdotdot

            1 Reply Last reply Reply Quote 0
            • T Offline
              thomthom
              last edited by 9 Nov 2010, 15:14

              @jim said:

              @thomthom said:

              on PC the position is stored between sessions, but not within sessions.

              All my (Windows) webdialogs re-open where I close them, same session and between sessions (unless SU is closed by a BugSplat.)

              When you do this?

              wd = UI::WebDialog.new('Foo Bar', 'test')
              wd.show

              (the window should appear at 0,0 at the screen)

              1. Move the window

              2. Close the window

              wd.show

              (the window at 0,0 - not its last position)

              1. Move the window again.

              2. Restart SU

              wd = UI::WebDialog.new('Foo Bar', 'test')
              wd.show

              (The window now appear at its last position)

              Thomas Thomassen β€” SketchUp Monkey & Coding addict
              List of my plugins and link to the CookieWare fund

              1 Reply Last reply Reply Quote 0
              • J Offline
                Jim
                last edited by 9 Nov 2010, 15:19

                That's not the correct initialization.

                wd = UI::WebDialog.new(title, scrollable, preferences_key)

                Needs the prefs key to store the location, so you need 3 args minimum.

                Hi

                1 Reply Last reply Reply Quote 0
                • J Offline
                  Jim
                  last edited by 9 Nov 2010, 15:27

                  Which doesn't seem to make any difference... now I need to go look how I'm doing it.

                  Ah, I see. Once SU is re-started, it won't occur. Only on new dialogs. I guess I've just never noticed that before.

                  Hi

                  1 Reply Last reply Reply Quote 0
                  • T Offline
                    thomthom
                    last edited by 9 Nov 2010, 15:35

                    oops - small typo in my sample there. I normally use a hash to create dialogs.

                    Thomas Thomassen β€” SketchUp Monkey & Coding addict
                    List of my plugins and link to the CookieWare fund

                    1 Reply Last reply Reply Quote 0
                    • F Offline
                      fredo6
                      last edited by 16 Jan 2011, 20:43

                      Hi again,

                      Is this problem on Mac confirmed, even with the M1 of SU8?

                      Apparently, there is a thread running in parallel on Google Sketchup Developers forum (initiated by Jonathan Winterflood) about the same problem.
                      http://groups.google.com/group/sketchupruby/browse_thread/thread/acd135fbdff21068

                      From what I read, there does not seem to be a solution.

                      Fredo

                      1 Reply Last reply Reply Quote 0
                      • J Offline
                        jeff hammond
                        last edited by 16 Jan 2011, 21:09

                        yeah, the same thing happens in the latest update.. the web dialogs won't remember their positions..

                        fwiw, here's the su .plist which shows a lot of the stuff that is remembered across session.. i doubt it will be of much help but it may lead to some sort of solution?
                        com.google.sketchuppro8.pdf

                        .

                        dotdotdot

                        1 Reply Last reply Reply Quote 0
                        • Dan RathbunD Offline
                          Dan Rathbun
                          last edited by 16 Jan 2011, 21:50

                          @unknownuser said:

                          on MAC, it seems that the position of web dialog are not saved across SU sessions, whatever you put in the regkey parameter (the 3rd one in the new method).

                          Am I the only one to notice this?

                          No. Jonathan Winterflood posted a topic on GoogleGroups about this:
                          Webdialog position/size and pref_key on Mac OS X


                          I'm not here much anymore.

                          1 Reply Last reply Reply Quote 0
                          • Dan RathbunD Offline
                            Dan Rathbun
                            last edited by 17 Jan 2011, 02:01

                            Hey there IS a weird thing I noticed with SU 8 ...

                            I involves the positions of both WebDailogs AND UI.messagebox (which I don't remember happening on v7.x)

                            Say I display a WebDialog at 0,0
                            Then I create a UI.messagebox, .. it displays over the top of the Webdialog (as if it's trying to center itself on the WD.)

                            If I repeat this but move the WD somewhere else, the messagebox seems to follow the WD.

                            But if you don't have a WD (or reverse the order of the calls,) the messagebox centers on the Sketchup window.

                            Is this behaviour new?

                            I can see a benefit to this, but the UI.messagebox method needs another argument " owner" that defaults to the Sketchup app window. Then if we want our webdialog to "own" a messagebox, we add the 3rd arg which is the WD instance.

                            And yes TIG, I know we can use alert and open to make JS dialogs, but the above is easier, as it's already on the Ruby side. IMHO

                            I'm not here much anymore.

                            1 Reply Last reply Reply Quote 0
                            • T Offline
                              thomthom
                              last edited by 17 Jan 2011, 08:13

                              That's interesting.
                              Do the webdialog have focus when UI.messagebox is called? In which case it would seem that it uses GetActiveWindow for its owner.
                              ...in which case, if you used a timer to delay a messagebox and set focus to one of the tool windows it should focus on them...

                              Thomas Thomassen β€” SketchUp Monkey & Coding addict
                              List of my plugins and link to the CookieWare fund

                              1 Reply Last reply Reply Quote 0
                              • Dan RathbunD Offline
                                Dan Rathbun
                                last edited by 17 Jan 2011, 09:03

                                @thomthom said:

                                Do the webdialog have focus when UI.messagebox is called? In which case it would seem that it uses GetActiveWindow for its owner.

                                Yes the messagebox follows the active window. You can test it yourself by moving the Console (adjust it so it's small.)
                                When it has focus type: UI.messagebox("Test")
                                Close it, move the Console, press the up arrow, and ENTER.

                                @thomthom said:

                                ...in which case, if you used a timer to delay a messagebox and set focus to one of the tool windows it should focus on them...

                                Unfortunately, WebDialogs are not created with JS open function, so window.owner is invalid for the Sketchup App window from within a WD.

                                Now close completely the Layers Window.
                                In the Console type (all one line.)
                                UI.show_inspector "Layers"; UI.messagebox("Test")

                                Weird huh?

                                I'm not here much anymore.

                                1 Reply Last reply Reply Quote 0
                                • D Offline
                                  driven
                                  last edited by 21 Jan 2011, 23:51

                                  @dan rathbun said:

                                  Unfortunately, WebDialogs are not created with JS open function, so window.owner is invalid for the Sketchup App window from within a WD.

                                  hi Dan,

                                  Does this mean that Mac WebDialogs arecreated with JS open function, this is what it say's on the can.

                                  If so what advantage might that give?

                                  and would this be part of the mac_only_use_nswindow?

                                  John

                                  learn from the mistakes of others, you may not live long enough to make them all yourself...

                                  1 Reply Last reply Reply Quote 0
                                  • Dan RathbunD Offline
                                    Dan Rathbun
                                    last edited by 22 Jan 2011, 01:13

                                    John .. I boo-booed. I meant to write window.opener for the DHTML/JS property. ("owner" is a system API term/property of window objects, at least on Win32.)

                                    This opener property is read/write, but may be a MSIE only feature, viz:

                                    @unknownuser said:

                                    (http://msdn.microsoft.com/en-us/library/ms534309(v)":22mneg1n]Standards Information

                                    There is no public standard that applies to this property.

                                    It usually says this when it's something Microsoft has addded or "invented" that is not defined in the W3C standards. (Otherwise it gives a link to the actaully HTML or CSS standard or specification at the W3C website.)

                                    The only way to know if Safari has "adopted" it, is to try it out on Safari and see if you get a scripting error. There is a JS script example on that opener Property reference page you could try.. and let us know if it works.

                                    On the page for the [window.open](http://msdn.microsoft.com/en-us/library/ms536651(v) method, at the bottom in the page forum, one of the responders says that this method was "invented" by Netscape (which is now Mozilla.org's 'Mozilla Suite' and 'Firefox'.)

                                    @driven said:

                                    If so what advantage might that give?

                                    If your webdialog instance could "know" what window opened it (it would be the Sketchup main application window,) and you could, after clicking a button, set the focus to the Sketchup app window.

                                    @driven said:

                                    Does this mean that Mac WebDialogs are created with JS open function, ...
                                    Not likely.. they are created by the Sketchup application code calling a system API function or a DLL function, like on Win32 it may be a function exposed in a library file, such as: msie.dll (I remember reading about it, might have a link somewhere... but you should get the point.)

                                    This is why I entered a Feature Request for a new Ruby API method UI.set_window_focus() (or some similar appropriate name.)

                                    Now... some of us DO know how to write that kind of Ruby method but only for Win32. It would not be cross-platform.

                                    To make it cross-platfrom, we would need collaboration with someone who knows Apple Objective-C and how to make either Carbon or Cocoa library calls. This may make it necessary to have a way for Sketchup Ruby to load the RubyCocoa framework.. which might require a special compiled copy of RubyCocoa (installed under Sketchup,) linked to the Sketchup's "private" Ruby framework,.. which is obsolete on Mac. PITA issues to deal with.

                                    I'm not here much anymore.

                                    1 Reply Last reply Reply Quote 0
                                    • OricAtmosO Offline
                                      OricAtmos
                                      last edited by 2 Mar 2012, 15:50

                                      @thomthom said:

                                      Haven't checked it out, but on PC the position is stored between sessions, but not within sessions. If you make a webdialog, close it, then open it again it doesn't remember the last position - only the last position from last session.

                                      Hi,

                                      I know this is an old thread, but I think I found out what makes WebDialogs remember their position during one session on Windows. It seems the position is only ever saved when the WebDialog object is destroyed, not when the dialog is closed while the object still lives. That's it, I think.

                                      1 Reply Last reply Reply Quote 0
                                      • 1 / 1
                                      • First post
                                        Last post
                                      Buy SketchPlus
                                      Buy SUbD
                                      Buy WrapR
                                      Buy eBook
                                      Buy Modelur
                                      Buy Vertex Tools
                                      Buy SketchCuisine
                                      Buy FormFonts

                                      Advertisement