OK-Button working on second call only

Started by tedicad, August 16, 2016, 05:52:14 AM

Previous topic - Next topic

tedicad

Hello friends,

my question probably is a dumb one, but I have not managed to solve the problem in quite some time now (everything else is working perfectly):

Upon calling my lisp-file, the dcl dialogue pops up as desired. I can fill out everything, but the moment I click on the OK-button to proceed, nothing happens. Close the dialogue, restart the lsp-file, dcl-dialogue reappears, and now (and in all following recalls) miracolously the OK-button works perfectly.

Something vital seems to be loaded only after I have closed the dialogue, something the OK-button or the entire dcl-dialogue desperately needs to be able to procede.

OpenDCL is installed as prescriped.

I initialize it and recall my dialogue with these lines:

  (command "_OPENDCL")
  (dcl_Project_Load "s203N.odcl" T)


(defun c:s203N_Form1_OnInitialize (/)
  (dcl_ListBox_AddList s203N_Form1_ListBox_s203typ s203Typ)
  ...
  )
 
 

; call the method to show the s:203 dialog box
(dcl_Form_Show s203N_Form1)

(defun c:s203N_Form1_OK_Button_OnClicked (/)
  (setq Val_s203Typ (dcl_ListBox_GetSelectedItems s203N_Form1_ListBox_s203typ))
  ...

  (dcl_Form_Close s203N_Form1)


Something must be wrong, but I have not been able to figure out what in three years, so I would be extremly grateful for some advice.

Thanks a lot in advance,

Holger

   

Fred Tomke

Hi, very simple: re-order your code! See the last paragraph of http://www.opendcl.com/HelpFiles/index.php?page=Usage/AutoLISP.htm.


  • define events
  • call dcl_form_show

Unfortunately, the event of ok was defined after dcl_form_show.

Regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

tedicad

Thank you!!! And sorry it took so long to respond, I have been working on a different projekt and only checked back now...
Thanks again, Holger