Toolbar problem in SU 8 on Windows
-
Has that been there since SU8? Or earlier? It'd be odd if it is earlier since the timer was bugged in pre-SU8...
-
@thomthom said:
Has that been there since SU8? Or earlier? It'd be odd if it is earlier since the timer was bugged in pre-SU8...
Yea.. I guess it's new. The ver7 Sandbox loader script does not have the UI.timer delay, but the SU8 version does.
-
And they, once again, made changes to the files, without bumping up the version number(s).
-
Or making notes in the public API docs...
-
Is there a place to report bugs such as this?
And/or are they worth reporting?
I suspect I would have gotten a better response if I had discovered the bug and reported it during Bets testing.
Our problem here is that we like to let the user choose and load one of 4 toolbars for our rendering product - depending on which one they want to run - so it is tricky to load the toolbar while SketchUp is loading, (which seems to avoid the problems), but rather to let the user choose which toolbar to load from the plugins menu.
-
The timer did not help.
Thanks for the idea, Dan.
It is interesting that I get a warning when starting the timer:
/aa/toolbar.rb:32: warning: Float 0.1 out of range
SU 7 does not give the warning.
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
Result in SU 8:
load '/aa/toolbar.rb'
/aa/toolbar.rb:33: warning: Float 0.1 out of range
toolar state: 1
Starting timer
After Starting timer
true -
-
@al hart said:
/aa/toolbar.rb:32: warning: Float 0.1 out of range
SU 7 does not give the warning.
The new core is more strict - the warning is probably because
0.1
suffers from rounding errors. -
Just when I was about to say, I was having no problems with Toolbars... I opened SU8 and got a toolbar shuffle for no apparent reason.
Anyway.. I turned off the Google toolbar.. and put the Sandbox toolbar where it was (last on the 1st row.)
Then I used the menu option "Save Toolbar Positions"
Then closed SU8
Then reloaded SU8 and it was where I put it.But, I'm very sure that I had not ever opened the Sandbox Ruby toolbar, and when I did, by checking the box in the Extensions panel, it just docked at the end of TB row 2, instead of floating.
So things are not right still in Sketchup Octoland...
... and Al, I do not get that float range error when running SU8 with Ruby v 1.8.7-p299
I'll try it in a min, with v 1.8.6-p287
~ -
@dan rathbun said:
So things are not right still in Sketchup Octoland...
Yes! I'm not mad!
But like you, I've been able to determine any pattern. I've pretty much settled on SU's Toolbar system being FUBAR.
-
@thomthom said:
The new core is more strict - the warning is probably because
0.1
suffers from rounding errors.i suspect it is because you can't set a timer to less that a full second.
I get the same error with 0.5, which shouldn't have any rounding errors:
UI.start_timer(0.5, false) {puts "A" }
(eval): warning: Float 0.5 out of range
20984
AThe message is even stranger when you pass if 2.0/10.0
UI.start_timer(2.0/10.0, false) {puts "A" }
(eval): warning: Float 2.0 out of range
20928
A -
I get no such errors in 7 or 8.
-
@dan rathbun said:
... and Al, I do not get that float range error when running SU8 with Ruby v 1.8.7-p299
~
The error is elusive, so it may be occurring when you run another script, but you can't see it.
How do you change the ruby version used internally by SketchUp?
-
@al hart said:
i suspect it is because you can't set a timer to less that a full second.
You can now in SU8!
-
@al hart said:
How do you change the ruby version used internally by SketchUp?
On the PC it's only a matter of renaming (for backup,) the old one from "msvcrt-ruby18.dll" to "msvcrt-ruby186-p287.dll"
Then go get another DLL from a higher patch level and/or branch and copy it into the SU folder. Most thsoe in the 1.8.x family are named "msvcrt-ruby18.dll", but the newer ones in 1.9.x have all 3 numbers in the file name. (ie: "msvcrt-ruby191.dll")
Sketchup is hardcoded to look for "msvcrt-ruby18.dll" -
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 -
@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.
-
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:
-
-
Windows7
Advertisement