Author Topic: CMDNAMES variabile or similar  (Read 1921 times)

0 Members and 1 Guest are viewing this topic.

Lupo76

  • Bull Frog
  • Posts: 343
CMDNAMES variabile or similar
« on: July 31, 2016, 10:37:13 AM »
Hi,
I'm using OpenDCL.
Within a ControlBar I put an event "MouseEntered".

I want to prevent the MouseEntered event's operation when there is an active command.
To do this I checked the variable (if (= (getvar "CMDNAMES") "").....
I want to prevent the event activation 'MouseEntered' even during the execution of a LISP function.

Unfortunately (getvar "CMDNAMES") returns "" when a LISP command is running.
How can I determine if a lisp function running?

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: CMDNAMES variabile or similar
« Reply #1 on: August 01, 2016, 04:02:24 AM »
In this topic (that you already know) command and lisp reactors and a global count variable are used. The same principle can be used here.

Lupo76

  • Bull Frog
  • Posts: 343
Re: CMDNAMES variabile or similar
« Reply #2 on: August 01, 2016, 04:58:18 AM »
In this topic (that you already know) command and lisp reactors and a global count variable are used. The same principle can be used here.

Sorry but I can not understand how the post you indicated to me can help me.  :cry:

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: CMDNAMES variabile or similar
« Reply #3 on: August 01, 2016, 08:57:15 AM »
In the linked code a global variable is used to count the number of active commands and Lisp functions. If a command starts 1 is added to the count, if a command is finished or cancelled 1 is subtracted. The same is done for Lisp expressions. If the global variable is zero no command or Lisp is active.