Attachment 'SIMPLE_SINGLE_SIZER_1_A.PY'

Download

#!/usr/bin/python

""" SIMPLE_SINGLE_SIZER_1_A.PY """

import wx

#------------------------------------------------------------------------------

class MainFrame( wx.Frame ) :
    """ A very basic 2-control single BoxSizer demo """
        
    def __init__( self, parent ) :
    
        #----  Configure the Frame.
        
        wx.Frame.__init__ ( self, parent, -1, title='SIMPLE_SINGLE_SIZER_1_A', 
                            size=(400, 300), pos=(100, 0),
                            style=wx.DEFAULT_FRAME_STYLE )
        # A panel is needed for tab-traversal and platform background color consistancy.
        frm_pnl = wx.Panel( self )
        frm_pnl.BackgroundColour = (255, 250, 240)
        
        #-----  Create the controls.
        
        # A "pos=" positioning parameter is allowed to be given, 
        #   but would be ignored and overridden by the sizer.
        caption_stTxt = wx.StaticText( frm_pnl, label='Caption Text' )
        
        frm_pnl.listing_txtCtrl = wx.TextCtrl( frm_pnl, style=wx.TE_MULTILINE, 
                                               size=(200, 150) )
        
        #-----  Create the sizer and add the controls to it.
        
        allCtrls_vertSizer = wx.BoxSizer( wx.VERTICAL )
        
        allCtrls_vertSizer.Add( caption_stTxt )
        allCtrls_vertSizer.Add( frm_pnl.listing_txtCtrl )
        
        # Apply the sizer to it's container :
        frm_pnl.SetSizer( allCtrls_vertSizer )
        frm_pnl.Layout()               # frm_pnl.Fit()  # Always use one or the other
        
    #end __init__

#end MainFrame class

#==============================================================================

if __name__ == '__main__' :

    app = wx.PySimpleApp( redirect=False )
    appFrame = MainFrame( None ).Show()
    app.MainLoop()

#end if

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2010-10-01 18:05:43, 15.0 KB) [[attachment:SIMPLE_SINGLE_SIZER_1_A.PNG]]
  • [get | view] (2010-10-01 18:07:24, 1.8 KB) [[attachment:SIMPLE_SINGLE_SIZER_1_A.PY]]
  • [get | view] (2010-10-01 18:06:05, 15.2 KB) [[attachment:SIMPLE_SINGLE_SIZER_1_B.PNG]]
  • [get | view] (2010-10-01 18:07:31, 1.9 KB) [[attachment:SIMPLE_SINGLE_SIZER_1_B.PY]]
  • [get | view] (2010-10-01 18:06:12, 14.8 KB) [[attachment:SIMPLE_SINGLE_SIZER_2_A.PNG]]
  • [get | view] (2010-10-01 18:07:38, 2.1 KB) [[attachment:SIMPLE_SINGLE_SIZER_2_A.PY]]
  • [get | view] (2010-10-01 18:06:20, 12.9 KB) [[attachment:SIMPLE_SINGLE_SIZER_2_B.PNG]]
  • [get | view] (2010-10-01 18:06:27, 15.1 KB) [[attachment:SIMPLE_SINGLE_SIZER_2_C.PNG]]
  • [get | view] (2010-10-01 18:07:48, 2.1 KB) [[attachment:SIMPLE_SINGLE_SIZER_2_C.PY]]
  • [get | view] (2010-10-01 19:14:26, 20.1 KB) [[attachment:SIMPLE_SINGLE_SIZER_SKETCH.PNG]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.

NOTE: To edit pages in this wiki you must be a member of the TrustedEditorsGroup.