Boolean Button + RunScript - Grasshopper2024-03-29T04:53:58Zhttps://www.grasshopper3d.com/forum/topics/boolean-button-runscript?commentId=2985220%3AComment%3A1816028&feed=yes&xn_auth=noThanks for this Post. This B…tag:www.grasshopper3d.com,2019-02-14:2985220:Comment:19632262019-02-14T14:50:46.357ZJoshuhttps://www.grasshopper3d.com/profile/Joshu
<p>Thanks for this Post. This Bug also appears with the "Quick Baker" in the Heteroptera Plug-in. I never would have found the issue.</p>
<p>Thanks for this Post. This Bug also appears with the "Quick Baker" in the Heteroptera Plug-in. I never would have found the issue.</p> Thanks for sharing! It's actu…tag:www.grasshopper3d.com,2017-09-19:2985220:Comment:18160282017-09-19T20:30:40.844ZXavier AMhttps://www.grasshopper3d.com/profile/XavierAyme
<p>Thanks for sharing! It's actually quite useful to know that, I had to remove many buttons to prevent this UI freeze bug...</p>
<p>Thanks for sharing! It's actually quite useful to know that, I had to remove many buttons to prevent this UI freeze bug...</p> If somebody is interested in…tag:www.grasshopper3d.com,2017-09-13:2985220:Comment:18128022017-09-13T12:22:07.793ZFlorian Frankhttps://www.grasshopper3d.com/profile/FlorianFrank
<p>If somebody is interested in a simple solution to this (without data dam):</p>
<p>Use another boolean variable to store the button value and actually run your code when the button state returns to false again:</p>
<pre> if(!run && !pending) //return when button isn't pressed <br></br> return;<br></br> if(!pending) //return & set pending to true {
pending = true;<br />
return;<br />
}<br></br>
pending = false; // reset pending to false<br />
…</pre>
<p>If somebody is interested in a simple solution to this (without data dam):</p>
<p>Use another boolean variable to store the button value and actually run your code when the button state returns to false again:</p>
<pre> if(!run && !pending) //return when button isn't pressed <br/> return;<br/> if(!pending) //return & set pending to true
{<br />
pending = true;<br />
return;<br />
}<br/>
pending = false; // reset pending to false<br />
RhinoApp.RunScript("_-Turntable Speed=30 Revolutions=1 Enter", false);</pre>
<p></p>
<p>compare it to a usual situation like this:</p>
<pre> if(!run) //return when button isn't pressed <br/> return;<br/> RhinoApp.RunScript("_-Turntable Speed=30 Revolutions=1 Enter", false);<br/>
</pre>
<p>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.<br/> <a href="http://storage.ning.com/topology/rest/1.0/file/get/2769320451?profile=original" target="_self"><img src="http://storage.ning.com/topology/rest/1.0/file/get/2769320451?profile=original" width="585" class="align-full"/></a><br/> Best,<br/> FF</p> If you use a data dam to dela…tag:www.grasshopper3d.com,2017-03-03:2985220:Comment:17049502017-03-03T22:15:24.432ZAdam Hollowayhttps://www.grasshopper3d.com/profile/AdamHolloway
<p>If you use a data dam to delay the button slightly it seems to work around this bug.</p>
<p>If you use a data dam to delay the button slightly it seems to work around this bug.</p> something new with that bug?tag:www.grasshopper3d.com,2014-02-25:2985220:Comment:10152102014-02-25T09:17:30.572ZSantiago Martín Lagunahttps://www.grasshopper3d.com/profile/SantiagoMartinLaguna
<p>something new with that bug?</p>
<p>something new with that bug?</p> "Button" seems to be freezing…tag:www.grasshopper3d.com,2013-08-12:2985220:Comment:8990942013-08-12T17:24:16.964ZJeet Palavwalahttps://www.grasshopper3d.com/profile/JeetPalavwala
<p>"Button" seems to be freezing the UI even with me. However the Boolean Toggle works very well.</p>
<p>"Button" seems to be freezing the UI even with me. However the Boolean Toggle works very well.</p> Seems like the Button is hogg…tag:www.grasshopper3d.com,2012-12-31:2985220:Comment:7578102012-12-31T17:29:10.346ZDavid Ruttenhttps://www.grasshopper3d.com/profile/DavidRutten
<p>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.</p>
<p></p>
<p>Looks fixable. Probably. It'll have to wait till next year though.</p>
<p></p>
<p>--</p>
<p>David Rutten</p>
<p>david@mcneel.com</p>
<p>Poprad, Slovakia</p>
<p>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.</p>
<p></p>
<p>Looks fixable. Probably. It'll have to wait till next year though.</p>
<p></p>
<p>--</p>
<p>David Rutten</p>
<p>david@mcneel.com</p>
<p>Poprad, Slovakia</p>