Hi,

I am a beginner in wxLua. Using the wxAUI sample application as a base I am struggling with avoiding to
open a panel more than once.

Here is the code I am using for the panel:

function Panel:create(parent, frame, _d3)
self.this = wx.wxPanel(parent.this, wx.wxID_ANY, wx.wxDefaultPosition, wx.wxDefaultSize, wx.wxTAB_TRAVERSAL, "Panel")
    self.m_frame = frame
    local this = self.this

    self.d3 = _d3

    local grid_sizer = wx.wxGridSizer(2,2,2,2);
    grid_sizer:SetHGap(5);

    -- More controls ...

    return self
end

function MyFrame:OnPanel(event)
    local pane = self.m_mgr:GetPane(wxT("Panel"))

    if not pane:IsOk() then
        myPanel_Panel = Panel:create(self, self, d3);
        self.m_mgr:AddPane(myPanel_Panel.this, wxaui.wxAuiPaneInfo():
                  Name(wxT("Panel")):Caption(wxT("Panel")):
                  Bottom():
                  CloseButton(true):MaximizeButton(true));

        self.m_mgr:Update();
    else
        pane:Show()
    end
end


I have got it working to avoid opening a second window, but when I close the pane, I didn't get it back reopened. Also I have a local MyFrame and the panels are implemented in separate files, so I don't know exactly if I could access MyFrame to change a variable in that class to indicate pane closed.

Any help ?

Thanks

Lothar

-- | Rapid Prototyping | XSLT Codegeneration | http://www.lollisoft.de
Lothar Behrens
Heinrich-Scheufelen-Platz 2
73252 Lenningen








------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to