Hello Guest it is March 29, 2024, 02:08:36 AM

Author Topic: wx.wxMessageBox question  (Read 1480 times)

0 Members and 1 Guest are viewing this topic.

wx.wxMessageBox question
« on: January 25, 2018, 01:57:26 PM »
Fairly new at this and a little confused about the MessageBox widget. Some sample macros I have looked at use this widget to display a message and wait for an OK. I have coded a simple M6 macro which correctly
displays a message and waits for an OK before clearing the message box, but the Gcode continues to execute even when I have not hit OK. I want the Gcode to wait for the OK response from the MessageBox. Any help would be appreciated.  Here is my macro:

function M6()
   --Display reminder message for: expected tool and zeroing of Z.

   local inst = mc.mcGetInstance()
   local selectedtool = mc.mcToolGetSelected(inst)
   local currenttool = mc.mcToolGetCurrent(inst)
   local changetoo = mc.mcToolGetDesc(inst,selectedtool) --** Get tool description from tool table
   
   lwx.wxMessageBox("Please verify the installation and zeroing of:\n    - tool number "..selectedtool.."\n    - "..changetoo)
   --mc.mcCntlToolChangeManual(inst) -- Tried with this included but no difference
   mc.mcToolSetCurrent(inst, selectedtool)
end

if (mc.mcInEditor() == 1) then
    M6()
end

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: wx.wxMessageBox question
« Reply #1 on: January 25, 2018, 04:09:20 PM »
The code above has lwx.wxMessageBox().  What is lwx?  A typo?  It should be wx.wxMessagebox.  Probably the macro is failing to compile and it is just running the old stale version. 

Steve
Re: wx.wxMessageBox question
« Reply #2 on: January 26, 2018, 11:11:34 PM »
Sorry, typo. it's wx not lwx. I am getting the popup window so must be executing this macro, but execution of Gcode file keeps going past the M6 line even though I did not hit OK.