algorithmic modeling for Rhino
I just came across a strange GH UI issue. Running a script that calls RhinoApp.RunScript and is triggered with a button object seems to freeze the GH UI to a certain extent - it stops responding to double clicks. Pressing the button a second time fixes the issue. This is easily reproducible with a simple setup:
pressing the button once, no response to double clicks (to edit the script, or a panel, etc)... and a second time it recovers.
Tags:
Seems like the Button is hogging all mouse events. I can't quite repeat it as crisply as mentioned, though after some clicks all mouse events are ignored on the canvas except a further click on the button.
Looks fixable. Probably. It'll have to wait till next year though.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
"Button" seems to be freezing the UI even with me. However the Boolean Toggle works very well.
something new with that bug?
If you use a data dam to delay the button slightly it seems to work around this bug.
If somebody is interested in a simple solution to this (without data dam):
Use another boolean variable to store the button value and actually run your code when the button state returns to false again:
if(!run && !pending) //return when button isn't pressed
return;
if(!pending) //return & set pending to true {
pending = true;
return;
}
pending = false; // reset pending to false
RhinoApp.RunScript("_-Turntable Speed=30 Revolutions=1 Enter", false);
compare it to a usual situation like this:
if(!run) //return when button isn't pressed
return;
RhinoApp.RunScript("_-Turntable Speed=30 Revolutions=1 Enter", false);
This bug occurs everytime your script releaes the focus of the grasshopper window. RunScript is just one of the cases. Attached is the gh file, which shows the problem and the solution.
Best,
FF
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson.
Powered by