Hello, when I use the code that is on http://wxlua.sourceforge.com (here is
the code in case you forgot:)

frame = wx.wxFrame(wx.NULL, wx.wxID_ANY, "wxLua Minimal Demo",
                   wx.wxDefaultPosition, wx.wxSize(450, 450),
                   wx.wxDEFAULT_FRAME_STYLE)

-- create a simple file menu
local fileMenu = wx.wxMenu()
fileMenu:Append(wx.wxID_EXIT, "E&xit", "Quit the program")
-- create a simple help menu
local helpMenu = wx.wxMenu()
helpMenu:Append(wx.wxID_ABOUT, "&About",
                "About the wxLua Minimal Application")

-- create a menu bar and append the file and help menus
local menuBar = wx.wxMenuBar()
menuBar:Append(fileMenu, "&File")
menuBar:Append(helpMenu, "&Help")
-- attach the menu bar into the frame
frame:SetMenuBar(menuBar)

-- create a simple status bar
frame:CreateStatusBar(1)
frame:SetStatusText("Welcome to wxLua.")

-- connect the selection event of the exit menu item to an
-- event handler that closes the window
frame:Connect(wx.wxID_EXIT, wx.wxEVT_COMMAND_MENU_SELECTED,
              function (event) frame:Close(true) end )
-- connect the selection event of the about menu item
frame:Connect(wx.wxID_ABOUT, wx.wxEVT_COMMAND_MENU_SELECTED,
        function (event)
            wx.wxMessageBox('This is the "About" dialog of the Minimal
wxLua sample.',
                            "About wxLua",
                            wx.wxOK + wx.wxICON_INFORMATION,
                            frame)
        end )

-- finally, show the frame window
frame:Show(true)



--------------------------------------
I  get an error when I go to help --> about(in it's own window):
Lua: Error while running chunk
E:\lua\wxLua\init.lua:38: wxLua: expected a 'wxWindow'
for parameter 4, but got a 'nil'.
Function called: 'wxMessageBox(string,string,number,nil)'
01. wxMessageBox([string,string,number,wxWindow,number,number])
stack traceback:
        [C]: in function 'wxMessageBox'
        E:\lua\wxLua\init.lua:38: in function
<E:\lua\wxLua\init.lua:37>
       [C]: in function 'MainLoop'
        C:\Program Files (x86)\Lua\5.1\lExecuter.wlua:799: in
function '__main'
        C:\Program Files (x86)\Lua\5.1\lExecuter.wlua:802: in main
chunk
        [C]: ?



Yes, I did start this in the lexecutor that was included with Lua for
Windows, and I am also using the wxLua that was included with Lua for
Windows.
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to