Author Topic: Starting a LISP when switching Tabs ?  (Read 1641 times)

0 Members and 1 Guest are viewing this topic.

snownut2

  • Swamp Rat
  • Posts: 971
  • Bricscad 22 Ultimate
Starting a LISP when switching Tabs ?
« on: February 20, 2011, 10:51:57 AM »
My research here found little regarding this subject.  Is it possible to enter a lisp function when switching paperspace tabs ? If so can anyone give an example.


Thanks

gile

  • Gator
  • Posts: 2520
  • Marseille, France
Re: Starting a LISP when switching Tabs ?
« Reply #1 on: February 20, 2011, 11:13:31 AM »
Hi,

You can use a VLR-Miscellaneous-Reactor handling the :VLR-layoutSwitched event.

Here's a simple example:

Code: [Select]
;; Activate the reactor
(defun c:TabReaOn ()
  (setq *TabReactor*
(VLR-Miscellaneous-Reactor
   nil
   '((:VLR-layoutSwitched . TabReaCallback))
)
  )
  (princ)
)

;; Deactivate the reactor
(defun c:TabReaOff ()
  (and
    *TabReactor*
    (vlr-remove *TabReactor*)
    (setq *TabReactor* nil)
  )
  (princ)
)

;; Callback function
(defun TabReaCallback (rea lst)
  (alert (strcat "Switch to " (car lst)))
)
Speaking English as a French Frog