Author Topic: (dcl-control-SetEnabled ctrlName nil) failing  (Read 96 times)

Jim Short

  • Full Member
  • ***
  • Posts: 218
    • Tahl Inc
(dcl-control-SetEnabled ctrlName nil) failing
« 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
Jim Short

owenwengerd

  • Administrator
  • Hero Member
  • *****
  • Posts: 2909
    • Outside The Box
Re: (dcl-control-SetEnabled ctrlName nil) failing
« Reply #1 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 property to '1 - Asynchronous '. Alternatively, your event handler can post a command (using e.g. dcl-SendString) and return immediately so that Windows can catch up with all waiting work before running the command and freezing things up again.

Jim Short

  • Full Member
  • ***
  • Posts: 218
    • Tahl Inc
Re: (dcl-control-SetEnabled ctrlName nil) failing
« Reply #2 on: October 21, 2017, 08:34:02 AM »
Thanks Owen,
Run button already Asynchronous.
Will try dcl-sendstring.
Jim
Jim Short

Jim Short

  • Full Member
  • ***
  • Posts: 218
    • Tahl Inc
Re: (dcl-control-SetEnabled ctrlName nil) failing
« Reply #3 on: October 22, 2017, 06:36:01 AM »
dcl-sendstring did not work either.
I will pursue different approach.
Jim Short