441
Mach4 General Discussion / Re: Getting this error when I try to use a message box with my M6 Script
« on: August 05, 2019, 11:55:40 PM »
The error is what it says. You can't use wxMessageBox in any thread other than the main thread. But it is a programmer error and not a bug type of error. You can use wxMessageBox() in the PLC script because the PLC script is run in the main thread of the GUI.
Using wxMessageBox() isn't a really good idea inside of Mach. It is there because it is part of wxLua. But just because it is there doesn't mean it is a good thing to use. Use mc.mcCntlSetLastError() instead. Or have the PLC script look at a flag or something to use wxMessageBox().
Steve
Using wxMessageBox() isn't a really good idea inside of Mach. It is there because it is part of wxLua. But just because it is there doesn't mean it is a good thing to use. Use mc.mcCntlSetLastError() instead. Or have the PLC script look at a flag or something to use wxMessageBox().
Steve