sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Toolbar problem in SU 8 on Windows

    Scheduled Pinned Locked Moved Developers' Forum
    27 Posts 4 Posters 2.0k 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.
    • Dan RathbunD Offline
      Dan Rathbun
      last edited by

      Very strange... Al you may want to see if a plugin overrode UI.start_timer, by dumping a methos list: UI.methods.sort
      look for a "old_start_timer etc.

      Or set $VERBOSE=trueand open the console before anyother rubies load.
      When a method gets overriden, Ruby issues a warning to the console.
      You can use a script snippet I posted: http://forums.sketchucation.com/viewtopic.php?f=180&t=30539#p269522

      I'm not here much anymore.

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

        @dan rathbun said:

        Very strange... Al you may want to see if a plugin overrode UI.start_timer, by dumping a methos list: UI.methods.sort
        look for a "old_start_timer etc.

        I'm also seeing warnings like Al reports.

        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

          Well then maybe you both dump a plugins Dir listing and compare.

          I have Google Tools: DCs, Sandbox, SolarNorth, and Photo(Web)Textures loaded.
          3rd party Plugins: only Fredo's BezierSpline1.4, Smustard Organizer and my ver2ofOceanModeling.

          ( It occurs to me that you guys might not have the correct Win32API.so file for v1.8.6-p287,
          I remember having some problems with and old copy of Win32API.so, when I first started using v1.8.6 with SU7. )

          Here's the 2 so files distro'd with v1.8.6-p287:


          v186_p287_so.zip

          I'm not here much anymore.

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

            @thomthom said:

            I'm also seeing warnings like Al reports.

            On XP or Vista ??
            .

            I'm not here much anymore.

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

              Windows7

              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

                @al hart said:

                The timer did not help. Thanks for the idea, Dan.
                ...

                Has anyone tried my code (You do not actually need any .PNG files) and/or does anyone have a small .rb which I can load from a directory, rather than putting in plugins to see what it does?

                Latest code:

                
                >  toolbar = UI;;Toolbar.new "Test2"
                >  # This toolbar icon simply displays TestX on the screen
                >  cmd = UI;;Command.new("Test2") { 
                >    UI.messagebox "Test2"
                >  }
                >  cmd.small_icon = "ToolPencilSmall.png"
                >  cmd.large_icon = "ToolPencilLarge.png"
                >  cmd.tooltip = "Test Toolbars"
                >  cmd.status_bar_text = "Testing the toolbars class"
                >  cmd.menu_text = "Test2"
                >  toolbar = toolbar.add_item cmd
                > 
                >  cmd = UI;;Command.new("Test3") { 
                >    UI.messagebox "Test3"
                >  }
                >  cmd.small_icon = "ToolPencilSmall.png"
                >  cmd.large_icon = "ToolPencilLarge.png"
                >  cmd.tooltip = "Test Toolbars"
                >  cmd.status_bar_text = "Testing the toolbars class"
                >  cmd.menu_text = "Test3"
                >  toolbar = toolbar.add_item cmd
                >  toolbar.show
                > 
                >   # Show toolbar if it was open when we shutdown.
                >   state = toolbar.get_last_state
                > printf("toolar state; %s\n", state)
                >   if (state == TB_VISIBLE)
                >     toolbar.restore
                >     # Per bug 2902434, adding a timer call to restore the toolbar. This
                >     # fixes a toolbar resizing regression on PC as the restore() call
                >     # does not seem to work as the script is first loading.
                > printf("Starting timer\n")
                >     UI.start_timer(0.1, false) {
                >       toolbar.restore
                >     }
                > printf("After Starting timer\n")
                >   end
                > 
                

                Just noticed a few boo-boos when rereading this old post.

                (1) The statement toolbar.show (on line 22 of the snippet,) defeats the state/restore block that follows.

                (2) The state/restore conditional block would only work on the second toolbar "Test3" (otherwise you need a state/restore block after defining each toolbar, if you are going to keep reusing the same reference, in this case the identifier toolbar.)


                My latest recommended snippet is in this post:
                Re: How to use the toolbar.show method

                ******* You could wrap the snippet in a method block called:
                toolbar_restore(toolbar)
                and then pass each toolbar reference to the method after creation, so as to make your code more "clean". (Also vars delay and state will be local to the method and get cleaned up automatically.)
                ~

                I'm not here much anymore.

                1 Reply Last reply Reply Quote 0
                • Al HartA Offline
                  Al Hart
                  last edited by

                  We are still struggling with Toolbars in SU8.

                  Our biggest remaining problem, is that that when we load a plugin by hand, rather than having it loaded automatically as SketchUp loads - (we offer both options to users - always load the app, or manually load it from the Plugins menu) - the toolbar appears - but is not docked.

                  I looked at your code snippet in the other thread, but it is hard to figure out how to put everything together.

                  Can you, (or someone), provide a .RB which I can execute manually, (not placing it in the plugins folder - but loading the .RB from the ruby console - or later from the Plugins menu), which creates a new toolbar, and docks it properly?

                  Then I can grab from it what I need, etc. to get it to work with our app.

                  Al Hart

                  http:wiki.renderplus.comimageseefRender_plus_colored30x30%29.PNG
                  IRender nXt from Render Plus

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

                  Advertisement