OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: Jim Short on October 16, 2017, 02:40:53 PM

Title: (dcl-control-SetEnabled ctrlName nil) failing
Post by: Jim Short on October 16, 2017, 02:40:53 PM
I have a docked form with a tree that will not respond to (dcl-control-SetEnabled treeCntrl nil) when called from c:uMill/Outline/RunButton#OnClicked if it is followed by any expression that has a loop. (any being untested for every possibility)
A F9 stop in Visual Lisp  will allow the desired affect. Removing it will by pass the affect. Does anyone have ideas about what is going on here?
Jim
Title: Re: (dcl-control-SetEnabled ctrlName nil) failing
Post by: owenwengerd on October 19, 2017, 09:33:49 PM
When your lisp code is in a loop, no Windows messages can be processed, so pending Windows messages just sit in the queue waiting to be processed. Meantime the UI is "frozen". You can probably resolve this by changing your button's Event Invoke (http://www.opendcl.com/HelpFiles/index.php?page=Reference/Property/EventInvoke.htm) property to '1 - Asynchronous '. Alternatively, your event handler can post a command (using e.g. dcl-SendString (http://www.opendcl.com/HelpFiles/index.php?page=Reference/Function/SendString.htm)) and return immediately so that Windows can catch up with all waiting work before running the command and freezing things up again.
Title: Re: (dcl-control-SetEnabled ctrlName nil) failing
Post by: Jim Short on October 21, 2017, 08:34:02 AM
Thanks Owen,
Run button already Asynchronous.
Will try dcl-sendstring.
Jim
Title: Re: (dcl-control-SetEnabled ctrlName nil) failing
Post by: Jim Short on October 22, 2017, 06:36:01 AM
dcl-sendstring did not work either.
I will pursue different approach.