This video was very useful I followed along and everything worked great. So now I added a basic screen, using wxFormBuilder and the screen will not show. In fact when I step through and on the return of the UI I get an error, per attachment.
Code for the button event is as follows:
local inst = mc.mcGetInstance()
local profile = mc.mcProfileGetName(inst)
local path = mc.mcCntlGetMachDir(inst)
package.path = path .. "\\Profiles\\" .. profile .. "\\Modules\\?.lua;" .. path .. "\\Modules\\?.lua;"
--CustFunc Module
package.loaded.mcTouchOff = nil
cf = require "mcTouchOff"
Tframe = cf.Dialog()
Code for the custom function is as follows:
local mcTouchOff = {} -- start of module Declare Module table
local inst = mc.mcGetInstance()
--require("wx")
--[[function mcTouchOff.GetSigState(sig) -- adds function to table
local hSig = mc.mcSignalGetHandle(inst,sig)
local state = mc.mcSignalGetState(hSig) -- get handle
return hSig
end
function mcTouchOff.SetSigState (sig, state)
local hSig = mc.mcSignalGetHandle(inst,sig)
mc.mcSignalSetState(hSig,state)
end]]
function mcTouchOff.Dialog()
UI = {}
UI.frameMain = wx.wxFrame (wx.NULL, wx.wxID_ANY, "TouchOff UI", wx.wxDefaultPosition, wx.wxSize( 900,530 ), wx.wxCAPTION + wx.wxCLOSE_BOX + wx.wxRESIZE_BORDER )
UI.frameMain:SetSizeHints( wx.wxSize( 900,530 ), wx.wxDefaultSize )
UI.frameMain :SetBackgroundColour( wx.wxColour( 255, 255, 255 ) )
return (UI.frameMain)
end
return mcTouchOff -- end of module
Your guidance would be appreciated.
Warm Regards,