[Fwd: mail test from Jean-Michel Fauth]

forwarded from JMF:

Dear Chris,

I apologize for this mail. I cann't post to the wxPython list.
Other adresses seem to work correctly; you can read this.

PS: To: or Cc: are correct.

···

----
<wxPython-users@lists.wxwindows.org>:
ezmlm-reject: fatal: List address must be in To: or Cc: (#5.7.0)

--- Below this line is a copy of the message.

Return-Path: <jfauth@bluewin.ch>
Received: (qmail 26446 invoked from network); 17 Feb 2006 09:11:13 -0000
Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88)
   by sunsite.dk with SMTP; 17 Feb 2006 09:11:13 -0000
Received: (qmail 18730 invoked from network); 17 Feb 2006 09:11:13 -0000
X-Spam-Checker-Version: SpamAssassin 3.1.0 on a.mx.sunsite.dk
X-Spam-Level:
X-Spam-Status: No, score=-2.6 required=6.0 tests=BAYES_00 autolearn=ham
   version=3.1.0
X-Spam-Hits: -2.6
Received: from mail11.bluewin.ch (195.186.18.61)
   by a.mx.sunsite.dk with SMTP; 17 Feb 2006 09:11:11 -0000
Received: from [192.168.1.33] (83.78.12.151) by mail11.bluewin.ch (Bluewin

7.2.071)
         id 43E4975A004186E8 for wxPython-users@lists.wxwindows.org; Fri,

17 Feb 2006 09:11:10 +0000
Message-ID: <43F5934C.2010501@bluewin.ch>
Date: Fri, 17 Feb 2006 10:11:40 +0100
From: jmf <jfauth@bluewin.ch>
User-Agent: Thunderbird 1.5 (Windows/20051201)
MIME-Version: 1.0
To: wxPython-users@lists.wxwindows.org
Subject: Best coding practice when using sizers?
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

I am cleaning the code of some large applications I have. The plan is to
use sizers in every frame, panel, dialog window (Good idea, isn't it?).

I cann't decide, what is the best code to use.

1. In the declaration of the controls, should I use wx.DefaultPosition
and wx.DefaultSize or should I drop them (seems logical)?

w1 = wx.Window(self, wx.NewId(), wx.DefaultPosition, wx.DefaultSize)
or
w1 = wx.Window(self, wx.NewId())

2. StaticLine. The default thickness of the line is 2. It seems, this
value has changed in the different wxPython releases. Am I wrong ?

3. Sometimes one wishes a size value for an item/control, that is
different from the default value. Where is the best place to define it;
at the level of the control declaration or in the sizer manager with an
SetItemMinSize().

4. Just a final side note. The GridBagSizer does not seem to be very
healthy. Coding mistakes have crashed Python (win2k, Py242, wxPy2621).
Any reports about this ?

Thanks for any hint, experience.

Jean-Michel Fauth, Switzerland

Some code...

class MyPanel(wx.Panel):

      def __init__(self, parent):
          wx.Panel.__init__(self, parent, -1)

          w1 = wx.Window(self, wx.NewId())
          w1.SetBackgroundColour(wx.RED)

          w2 = wx.Window(self, wx.NewId())
          w2.SetBackgroundColour(wx.BLUE)

          staline1 = wx.StaticLine(self, wx.NewId(),

style=wx.LI_HORIZONTAL)
          print staline1.GetSize()

          b1 = wx.Button(self, wx.NewId(), '&OK')
          b2 = wx.Button(self, wx.NewId(), '&Cancel')

          b = 5

          hsizer1 = wx.BoxSizer(wx.HORIZONTAL)
          hsizer1.Add(w1, 1, wx.EXPAND | wx.ALL, b)
          hsizer1.Add(w2, 1, wx.EXPAND | wx.ALL, b)

          hsizer2 = wx.BoxSizer(wx.HORIZONTAL)
          hsizer2.Add(b1, 0)
          hsizer2.Add(b2, 0, wx.LEFT, b)

          vsizer1 = wx.BoxSizer(wx.VERTICAL)
          vsizer1.Add(hsizer1, 1, wx.EXPAND | wx.ALL, b)
          vsizer1.Add(staline1, 0, wx.EXPAND | wx.ALL, b)
          vsizer1.Add(hsizer2, 0, wx.ALIGN_RIGHT | wx.ALL, b)

          self.SetSizer(vsizer1)

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov