Quantcast
Channel: MicroStation Programming - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 1677

Re: mdlState_startPrimitiveAndSetPopupMenu() - how to find out if it is already open?

$
0
0

I think you missed some technical understanding. mdlState_start... does as first thing stop any previous command. if cleanup-functions are installed those are called and anything else is reset. Right after calling the mentioned funtion, there should be NOTHING already open. See the following comment taken from the docs:

"This function terminates active commands. It also clears highlighting remaining from the previous command. If a temporary element remains from a previous command, this function erases it. It resets snap data, clears all state data, and sets up the state data using dataFunc, resetFunc, funcname and prompt."

Using global stuff is dangerous if you initialise it previously to calling the mdlState_start... function (no matter which of them) and have a cleanup-function that clears something. That might lead to cleared content of global vars while you expect them to be initialized. Initialization should always be done AFTER calling mdlState_start. Even see the comment to mdlView_setPopupMenu(), this tells you that the installed popup is reset with mdlState_startPrimitive.

I would suggest going the way to the C++ API where some of those irritating workflow is hidden and managed by the underlying classes.

If you have problems with variable init, you should show us some code to dive deeper into this.


Viewing all articles
Browse latest Browse all 1677

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>