Passed Reference of Control is Nil

The MenuItem is Handled by the calling window.

The calling window store the reference of the LisBox into a Property of the target window.

The target window have to populate a PopupMenu. I’ve done that in the Window Open Evnet: LB is Nil. Same applywhen I set the code into the PupupMenu’s Open Event.

Idea ?

I’d guess that the Open events happen before the calling window sets the Listbox property.

The window open event happens AFTER the controls open event

If you want to set something that control can access then you could use a constructor on the window, set the property then call super.constructor at which point the control open events will be run

Thanks guys.

In the mean time (my question, your answers), I tried to pass the data as string with the same failure (the string was empty).

Then, I put a new property in a Module and get it working (with some acrobat work-around).

The PopupMenu is now correctly populated and works fine (hummm. Work. Now I have to really add the code to do the real job: the PopupMenu react to the user action).

Sometimes, eating something, drinking a cup of coffee, talking with a friend is good for programming.

Copy / Paste sometimes is the programmer’s nightmare. I copy / pasted another window that does something similar (add instead of remove), using the same mechanism (enarly), but does not used the Open Event: thus my surprise: "of course, I do the same of what works in the original window ! Why does this fails ?"°.