sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    UI doesn't update

    Scheduled Pinned Locked Moved Developers' Forum
    6 Posts 4 Posters 288 Views 4 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.
    • G Offline
      GWD
      last edited by

      In several of my scripts sometimes the UI doesn't update during a part of the script execution. In the beginning the UI update correctly after a while it doesn't update anymore but the script is still running. After a while the scripts ends and everything is back to normal and the script has done what it should do. But the script is much slower when the UI doesn't update! How can I avoid this problem?

      regards,

      Guy

      1 Reply Last reply Reply Quote 0
      • Dan RathbunD Offline
        Dan Rathbun
        last edited by

        • If it's the various inspector dialogs such as Entity Info, Layers dialog, etc., you can call:

        UI.refresh_inspectors()

        • If it's the model client view you wish to refresh, you can call:

        Sketchup.active_model.active_view.refresh()

        I'm not here much anymore.

        1 Reply Last reply Reply Quote 0
        • thomthomT Offline
          thomthom
          last edited by

          None of that will work - when a ruby script starts to do lots of work the UI will not update and not become responsive. There is no API methods that will avoid that.

          Under OSX that statusbar will still update, but under Windows it will not. In some of my heavy processing plugins, such as CleanUp, I do a Win32 API call to PeekMessage to make the UI update - but the user still won't be able to interact with it.

          It's a very annoying behaviour of SketchUp that's been a source of complaints for a long time. Many developers has tried to find ways around it, threads etc without any luck. Fredo got a system with timers, that somewhat prevents the window from completely turning unresponsive, but it cannot be applied to all tasks and it add to the total processing time.

          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

            Sorry... I did not realize he was talking about "The curse of the Ghost Window"

            I'm not here much anymore.

            1 Reply Last reply Reply Quote 0
            • G Offline
              GWD
              last edited by

              @thomthom said:

              None of that will work - when a ruby script starts to do lots of work the UI will not update and not become responsive. There is no API methods that will avoid that.

              Under OSX that statusbar will still update, but under Windows it will not. In some of my heavy processing plugins, such as CleanUp, I do a Win32 API call to PeekMessage to make the UI update - but the user still won't be able to interact with it.

              It's a very annoying behaviour of SketchUp that's been a source of complaints for a long time. Many developers has tried to find ways around it, threads etc without any luck. Fredo got a system with timers, that somewhat prevents the window from completely turning unresponsive, but it cannot be applied to all tasks and it add to the total processing time.

              Thanks thomthom, now i know it's a SU problem.

              1 Reply Last reply Reply Quote 0
              • nikusknxN Offline
                nikusknx
                last edited by

                Update for Sketchup 2014 :

                
                require "Win32API.rb
                msg = "\000" * 36
                peekMessage = Win32API.new('user32','PeekMessage' , 'PLIII', 'I')
                peekMessage.call( msg, 0, 0, 0, 0x0000 ) != 0
                
                
                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