[wxPython] size of splitter windows

Hi,
I am relatively new to wxPython and I do have a
problem with the size of a splitter window.

here's my example:

···

-------------
from wxPython.wx import *

class ABA_CM(wxApp):
    def OnInit(self):
        title = "Test"
        frame = MainFrame(NULL, -1, title)
        frame.Show(true)
        self.SetTopWindow(frame)
        return true
#--
class MainFrame(wxFrame):
    def __init__(self, parent, id, title):
        wxFrame.__init__(self, parent, -1, title)

        splitter=wxSplitterWindow(self, -1)
        CMwin =
wxWindow(splitter, -1,size=wxDefaultSize,pos=wxDefaultPosition)
        ABAwin =
wxWindow(splitter, -1,size=wxDefaultSize,pos=wxDefaultPosition)
        splitter.SplitVertically(CMwin, ABAwin,sashPosition=0)
        CMwin.SetBackgroundColour(wxRED)
        ABAwin.SetBackgroundColour(wxBLUE)
        print CMwin.GetSizeTuple()
        print ABAwin.GetSizeTuple()
#--
app = ABA_CM(0)
app.MainLoop()
-------------------------

The sizes printed are definetly wrong, aren't they? I want to use
this SplitterWindow for two wxVTKRenderWindows:

renwin1=wxVTKRenderWindow(CMwin,-1)
renwin2=wxVTKRenderWindow(ABAwin,-1)

The images I get this way have a size of (20,20) and this is the
size of a window of which the size couldn't be determined, right?
So I guess there must be something wrong here. Any ideas?

Thanks

As I'm not subscribed to this list I would be extremly thankful for
mail.

Marcus Stojek
stojek@part-gmbh.de

Hi,
I am relatively new to wxPython and I do have a
problem with the size of a splitter window.

here's my example:
-------------
from wxPython.wx import *

class ABA_CM(wxApp):
    def OnInit(self):
        title = "Test"
        frame = MainFrame(NULL, -1, title)
        frame.Show(true)
        self.SetTopWindow(frame)
        return true
#--
class MainFrame(wxFrame):
    def __init__(self, parent, id, title):
        wxFrame.__init__(self, parent, -1, title)

        splitter=wxSplitterWindow(self, -1)
        CMwin =
wxWindow(splitter, -1,size=wxDefaultSize,pos=wxDefaultPosition)
        ABAwin =
wxWindow(splitter, -1,size=wxDefaultSize,pos=wxDefaultPosition)
        splitter.SplitVertically(CMwin, ABAwin,sashPosition=0)
        CMwin.SetBackgroundColour(wxRED)
        ABAwin.SetBackgroundColour(wxBLUE)
        print CMwin.GetSizeTuple()
        print ABAwin.GetSizeTuple()
#--
app = ABA_CM(0)
app.MainLoop()
-------------------------

The sizes printed are definetly wrong, aren't they? I want to use
this SplitterWindow for two wxVTKRenderWindows:

renwin1=wxVTKRenderWindow(CMwin,-1)
renwin2=wxVTKRenderWindow(ABAwin,-1)

The images I get this way have a size of (20,20) and this is the
size of a window of which the size couldn't be determined, right?
So I guess there must be something wrong here. Any ideas?

This is expected behaviour, because you give it no size hint at all.
Try to give your wxFrame an initial size or call SetClientSize thereafter.

Btw: try boa 0.1.0. It will directly generate source, where such problems
won't arise in the first place. Although it's an alpha release, it's extremly
helpful, whereas it's Help.py got essential for my python hackings...

Thanks

As I'm not subscribed to this list I would be extremly thankful for
mail.

Marcus Stojek
stojek@part-gmbh.de

Cheers,
  Hans-Peter

···

On Thursday, 7. March 2002 18:09, Marcus Stojek wrote:

Hans-Peter Jansen wrote:

Btw: try boa 0.1.0. It will directly generate source, where such problems
won't arise in the first place.

or wxDesigner. It costs money, but not much (depending on who you are,
of course), and the money goes to a major contributer to wxWindows.

I don't think Boa uses Sizers, does it? and I love sizers....

-Chris

···

--
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