On Wed, Jan 16, 2013 at 12:58 PM, Victor Bombi <[email protected]> wrote:
> Auto answering. I made a function (Collapsible) for getting what I wanted
This is fine too... see my other response.
> ///////////////////////////////
> but I have another question now:
> I need two windows (one will be for AUImanager)
> I wrote this. It does not work as I expected and also crashes on closing
> /////////////////////////////////////////////
> require("wx")
>
> frame = nil
> -- Generate a unique new wxWindowID
> local ID_IDCOUNTER = wx.wxID_HIGHEST + 1
> function NewID()
> ID_IDCOUNTER = ID_IDCOUNTER + 1
> return ID_IDCOUNTER
> end
> 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)
> paneltop = wx.wxPanel(panel, wx.wxID_ANY)
> panelbottom = wx.wxPanel(panel, wx.wxID_ANY)
>
> paneltopSizer = wx.wxBoxSizer( wx.wxHORIZONTAL )
> panelbottomSizer = wx.wxBoxSizer( wx.wxHORIZONTAL )
>
>
> for i=1,3 do
> local cc=wx.wxStaticText(paneltop, wx.wxID_ANY, "top "..i,
> wx.wxDefaultPosition,wx.wxDefaultSize, wx.wxALIGN_CENTRE)
> paneltopSizer:Add(cc,0,wx.wxGROW)
> end
>
> for i=1,3 do
> local cc=wx.wxStaticText(panelbottom, wx.wxID_ANY, "bottom "..i,
> wx.wxDefaultPosition,wx.wxDefaultSize, wx.wxALIGN_CENTRE)
> panelbottomSizer:Add(cc,0,wx.wxGROW)
> end
> paneltop:SetSizer(paneltopSizer);
> paneltopSizer:SetSizeHints(paneltop);
>
> panelbottom:SetSizer(panelbottomSizer);
> panelbottomSizer:SetSizeHints(panelbottom);
>
>
> panelSizer = wx.wxBoxSizer( wx.wxVERTICAL )
Don't add the child panel's sizers since the child panels already manage them.
> panelSizer:Add(paneltopSizer,1,wx.wxGROW)
> panelSizer:Add(panelbottomSizer,1,wx.wxGROW)
Add the child panels themselves and the panelSizer will check if the
child panels have sizers of their own to perform the layout.
panelSizer:Add(paneltop,1,wx.wxGROW)
panelSizer:Add(panelbottom,1,wx.wxGROW)
> panel:SetSizer(panelSizer);
> panelSizer:SetSizeHints(panel);
> -- show the frame window
> frame:Show(true)
> end
>
> main()
>
> wx.wxGetApp():MainLoop()
This was tough to find, but by remming out parts I was able to find
where the code that caused the crash came from.
Regards,
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