On Jan 5, 2008 2:25 PM, Ryan Pusztai <[EMAIL PROTECTED]> wrote: > 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
These are common in wxWidgets in GTK even with C++ code. All it means in this case is that the wxSizer is trying to size the wxFrame or wxButton before it had a chance to get a valid size so it's using wx.wxDefaultSize = (-1, -1). > 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. Not really, but you might want to provide some positive initial size for the wxFrame to get rid of the warnings. Also and I hope this is all it takes (can't test now) is that you create a single wxPanel child of the wxFrame. A single wxPanel child of a wxFrame takes the client size of the wxFrame and then you use a wxSizer to hold the children of the panel. Note how the sizer is for the panel, but we set the size hints for the wxFrame. frame = wx.wxFrame(wx.NULL, -1, "wxLua module sample") panel = wx.wxPanel(frame, -1) -- Layout all the buttons using wxSizers local mainSizer = wx.wxBoxSizer( wx.wxVERTICAL ) local ID_BUTTON = 1001 local buildButton = wx.wxButton( panel, ID_BUTTON, "Button1" ) mainSizer:Add( buildButton, 0, wx.wxALL + wx.wxEXPAND, 5 ) panel:SetSizer( mainSizer ) mainSizer:SetSizeHints( frame ) Hope this helps, John ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ wxlua-users mailing list wxlua-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxlua-users