I am getting all kinds of errors when using the wxLua Lua module in Linux.
In the Terminal I see errors for sizing upon creation. Here are the errors I
get when running:

$ lua luamodule.wx.lua
>
> (<unknown>:30818): Gtk-CRITICAL **: gtk_window_resize: assertion `height >
> 0' failed
>

Here is what I am trying to achieve. I have a simple script that has a
frame, menu, and a button. I attached the script to this post so that
testing can be done. I need to use wxLua as a Lua module. I made a custom
build file to create it because the current method shipped with wxLua does
not work for me. I don't think that has anything to do with the problem, I
just thought I would mention it. I can successfully run the minimal and
veryminimal samples, but I see the same results when trying to run a more
complex example.

Here is a bit more information. It displays the frame as a very small frame
or as a VERY long titlebar only. It displays the errors in the terminal when
I run it. If I comment out the SetSizeHints() I get the frame to show up
correctly, but it only has the menu. I don't see the controls. This works on
Windows, but not on Linux. I hope I am doing something wrong.

Thanks

<script>
package.cpath =
";;./?.dll;./?.so;../lib/?.so;../lib/vc_dll/?.dll;../lib/bcc_dll/?.dll;../lib/mingw_dll/?.dll;"
require("wx")

-- simple test of Non GUI elements
p = wx.wxPoint(1,2)
print("The point is", p:GetX(), p:GetY())

frame = wx.wxFrame(wx.NULL, -1, "wxLua module sample")

-- create a simple file menu so you can exit the program nicely
local fileMenu = wx.wxMenu()
fileMenu:Append(wx.wxID_EXIT, "E&xit", "Quit the program")
local menuBar = wx.wxMenuBar()
menuBar:Append(fileMenu, "&File")
frame:SetMenuBar(menuBar)
frame:Connect(wx.wxID_EXIT, wx.wxEVT_COMMAND_MENU_SELECTED,
              function (event) frame:Close(true) end )

-- Layout all the buttons using wxSizers
local mainSizer = wx.wxBoxSizer( wx.wxVERTICAL )
local ID_BUTTON = 1001
local buildButton = wx.wxButton( frame, ID_BUTTON, "Button1" )
mainSizer:Add( buildButton, 0, wx.wxALL + wx.wxEXPAND, 5 )
frame:SetSizer( mainSizer )
mainSizer:SetSizeHints( frame )

frame:Show(true)

-- ALWAYS call wx.wxGetApp():MainLoop() last to keep the program active
-- otherwise the lua program will exit immediately
wx.wxGetApp():MainLoop()
</script>
-- 
Regards,
Ryan
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to