On Mon, Jan 14, 2013 at 1:08 PM, Victor Bombi <[email protected]> wrote:
> Hello,
>
> Cant get this test with sizers and wxCollapsiblePane to work!!
> What am I doing wrong
> //////////////
> require("wx")
>
> frame = nil
>
> function main()
>
> -- create the frame window
> frame = wx.wxFrame( wx.NULL, wx.wxID_ANY, "wxLua Very Minimal Demo",
> wx.wxDefaultPosition, wx.wxSize(450, 450),
> wx.wxDEFAULT_FRAME_STYLE )
> panel = wx.wxPanel(frame, wx.wxID_ANY)
> panelSizer = wx.wxBoxSizer( wx.wxVERTICAL )
> collaps = {}
> ---[[
> for i=1,3 do
> collaps[i] = wx.wxCollapsiblePane(panel, wx.wxID_ANY, "efecto"..i,
> wx.wxDefaultPosition,
> wx.wxSize(20,20))
> panelSizer:Add(collaps[i], 0, wx.wxGROW + wx.wxALL, 5);
> local wincolap = (collaps[i]):GetPane()
> paneSz = wx.wxBoxSizer(wx.wxVERTICAL);
> local cc=wx.wxStaticText(wincolap, wx.wxID_ANY, "vadsfklj "..i,
> wx.wxDefaultPosition,wx.wxDefaultSize, wx.wxALIGN_CENTRE)
> paneSz:Add(cc, 1, wx.wxGROW + wx.wxALL, 2);
> wincolap:SetSizer(paneSz);
> paneSz:SetSizeHints(wincolap);
> --panelSizer:Add(paneSz, 0, wx.wxALL, 0)
-- Add this to force the layout to be recalculated.
-- I'm not sure why this is not automatic... I have only used this
control once and it worked without this.
collaps[i]:Connect(wx.wxID_ANY, wx.wxEVT_COMMAND_COLLPANE_CHANGED,
function(event) collaps[i]:GetContainingSizer():Layout() end)
> end
> --]]
> last = wx.wxStaticText(panel, wx.wxID_ANY, "last 1",
> wx.wxDefaultPosition,wx.wxDefaultSize, wx.wxALIGN_CENTRE)
> panelSizer:Add(last,0)
> last2 = wx.wxStaticText(panel, wx.wxID_ANY, "last 2",
> wx.wxDefaultPosition,wx.wxDefaultSize, wx.wxALIGN_CENTRE)
> panelSizer:Add(last2,0)
>
> panel:SetSizer(panelSizer);
> panelSizer:SetSizeHints(panel);
> -- show the frame window
> frame:Show(true)
> end
>
> main()
>
> wx.wxGetApp():MainLoop()
>
Hope that helps,
John
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
wxlua-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wxlua-users