Where do I store local handlers with Modeless and Palettes ?

Started by krunch, December 12, 2010, 02:37:24 AM

Previous topic - Next topic

krunch

Hi
Something I didn't understood..

With complex Modeless/Palettes we need local handlers to manage datas in the form.
These datas only concern the form, they are not usefull when the form is closed.

With Modal box there's no problem. In the help file (Application Development) you give the following example (where Result is one of these datas) :

Code (autolisp) Select
(defun C:MyCommand (/ Result)
 (command "_OPENDCL") ; Load OpenDCL Runtime
 (if (dcl_Project_Load "MyProject") ; Load project data from MyProject.odcl
   (progn
     (setq Result (dcl_Form_Show MyProject_MyForm))
     ; Note that this code does not execute until *after* the dialog is closed!
     (if (= Result 1) (DoSomething))
   )
 )
 (princ)
)


But with Modeless and Palettes the behavior is different : the whole function is evaluated, and then locals handlers are no longer availables for other triggering.
So the
Code (autolisp) Select
; Note that this code does not execute until *after* the dialog is closed! is correct only with Modal.

Where can we store local handlers to hold them while the Modeless/Palette is opened ?
Do they have to be global ?

owenwengerd

Owen Wengerd (Outside The Box) / ManuSoft