#!/usr/bin/env python
# -*- coding: utf-8 -*-#

import wx
import wx.lib.sized_controls as sc
        
########################################################################
class MainFrame(sc.SizedFrame):
    #----------------------------------------------------------------------
    def __init__(self, parent, **kwds):
        super(MainFrame, self).__init__(parent, wx.ID_ANY, **kwds)
        
        self.SetTitle("static box and double buffer")
        
        self.createControls()

    def createControls(self):
        paneContent = self.GetContentsPane()

        paneContent.SetDoubleBuffered(True)
        
        staticB = wx.StaticBox(paneContent, wx.ID_ANY, "The static box")
        staticB.SetSizerProps(expand=1, proportion=1)
        bSizer = wx.BoxSizer(wx.VERTICAL)
        staticB.SetSizer(bSizer)
        
        paneSSBC = sc.SizedPanel(staticB)
        paneSSBC.SetSizerType('grid',  {'cols': 2})
        bSizer.Add(paneSSBC)
       
        st = wx.StaticText(paneSSBC, wx.ID_ANY, 'static4 1')
        tc = wx.TextCtrl(paneSSBC, wx.ID_ANY, 'tc4 1')
        #st = wx.StaticText(paneSSBC, wx.ID_ANY, 'static4 2')
        #tc = wx.TextCtrl(paneSSBC, wx.ID_ANY, 'tc4 2')
        #st = wx.StaticText(paneSSBC, wx.ID_ANY, 'static4 3')
        #tc = wx.TextCtrl(paneSSBC, wx.ID_ANY, 'tc4 3')


if __name__ == '__main__':
    # we use the WIT for the app, it is a very powerfull tool to help debug
    # layout issues and many other things, run it and try ctrl-alt-i
    # for more detail check out the wiki:
    # http://wiki.wxpython.org/Widget%20Inspection%20Tool
    import wx.lib.mixins.inspection as WIT
    app = WIT.InspectableApp(redirect=False)

    frame = MainFrame(None)
    frame.Show()
    app.MainLoop()
        
        
    
    