lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Dear Developers and Users of wxLua,

I wanted to create a frame with two sizers.
The first sizer is supposed to be vertical
and the second one should be horizontal
and should be placed within the first one.
Please see the attachement.

Consider the following code:

------------------------------------------------------------------------------------------------
frame = wx.wxFrame(wx.wxNull,  -1,  "wxLua sizer test frame")
sizerV = wx.wxBoxSizer(wx.wxVERTICAL)

frame:SetSizer(sizerV)
frame:SetAutoLayout(wx.TRUE)
sizerV:SetSizeHints(frame)
sizerV:Fit(frame)

staticText1 = wx.wxStaticText( frame, wx.wxID_STATIC, "Static text 1",
wx.wxDefaultPosition, wx.wxDefaultSize, 0 )
sizerV:AddWindow(staticText1, 0, wx.wxALL, 5)

sizerH = wx.wxBoxSizer(wx.wxHORIZONTAL);
sizerV:AddWindow(sizerH, 0, wx.wxALL, 5)

staticText2 = wx.wxStaticText( frame, wx.wxID_STATIC, "Static text 2",
wx.wxDefaultPosition, wx.wxDefaultSize, 0 )
sizerH:AddWindow(staticText2, 0, wx.wxALL, 5)

ID_BUTTON1 = 1000
button1 = wx.wxButton( item1, ID_BUTTON1, "Button", wx.wxDefaultPosition,
wx.wxDefaultSize, 0 )
sizerH:AddWindow(button1, 0, wx.wxALL, 5)

wx.wxGetBaseApp():SetTopWindow(frame)
frame:Show(wx.TRUE)
------------------------------------------------------------------------------------------------

The wxLua 5.0 interpreter stops when the line

>> sizerV:AddWindow(sizerH, 0, wx.wxALL, 5)

is encountered.

The following error message is issued:

wxLua : Error while running chunk wxLua: Unexpected user defined data type
for parameter 2

What could have gone wrong?

Are there special rules for placing sizers within
sizers?


Best regards,


Waldemar Razik



(See attached file: frame.gif)



Attachment: frame.gif
Description: GIF image