Machsupport Forum
Mach Discussion => Mach4 General Discussion => Topic started by: Bill_O on August 11, 2020, 10:57:50 AM
-
I found some old threads about different message boxes.
I could use one with a yes or no option.
When I did any option for the message box it gave me an error.
Why is this code not working?
--------------------------------------
--test
---------------------------------------
function Test()
inst = mc.mcGetInstance()
rc = wx.wxMessageBox("Testing yes no box",2)
if (rc == 2) then
wx.wxMessageBox("Yes was pressed")
elseif (rc == 8) then
wx.wxMessageBox("No was pressed")
else
wx.wxMessageBox("Did not work")
end
end
---------------------------------------------------------------
Thanks,
Bill
-
Hi Bill,
Try
rc = wx.wxMessageBox("Message", "Title of box", wx.wxYES_NO)
if (rc == wx.wxYES) then
--yes was pressed
elseif (rc == wx.wxNO) then
--no was pressed
end
-
Swifty,
Worked great.
I had tried some code similar to what you showed but was missing a few little things.
Thanks for the help.
Bill