Determine size of wxSplitterWindow

Marcus Stojek stojek at part-gmbh.de
Thu Mar 7 14:38:02 EST 2002


Hi,

I have cut down my problem. It seems to be impossible
for me to determine the size of a wxSplitterWindow. The results of
GetSizeTuple() are wrong. How comes?

btw.: sashPostion=0 should split the Window in the middle,
which it does not.


Tanks for any help.
Marcus

-----snip--
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,size=wxDefaultSize,
                         pos=wxDefaultPosition)

        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()
-----snap--	



More information about the Python-list mailing list