By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,903 Members | 1,973 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,903 IT Pros & Developers. It's quick & easy.

wxPython problem switching between 2 wx.SplitterWindow's

P: n/a
I have posted this problem also on the wxpython-users list, but maybe
someone here can also help.

I want to keep 2 different views for the same object, both views using
SplitterWindow. So I am trying to create 2 SplitterWindow's, keeping both
in memory, and alternately show only one of them. However, that doesn't
work and I've tried all kinds of combinations of Show, SplitVertically,
UpdateSize, and Layout.

I think I have isolated the problem in this code snippet (also attached).
This code actually works. But un-comment the 2 lines for splitter2 and you
will see the problem:
#!/usr/bin/env python
import wx

class myFrame(wx.Frame):
def __init__(self, parent):
wx.Frame.__init__(self,
parent=parent)
self.SetClientSize(wx.Size(600, 500))
self.splitter1=wx.SplitterWindow(self)
self.splitter1.Hide()
#self.splitter2=wx.SplitterWindow(self) # un-comment and you'll
#self.splitter2.Hide() # see the problem
def showSplitter(self, id):
if id==1:
self.splitter1.Show()
if id==2:
self.splitter2.Show()

class myApp(wx.App):
def OnInit(self):
wx.InitAllImageHandlers()
self.mainWin = myFrame(None)
self.mainWin.Show()
self.SetTopWindow(self.mainWin)
self.mainWin.showSplitter(1)

return True

if __name__ == '__main__':
application = myApp(0)
application.MainLoop()

I have cut it down to the bone, so there are no children in the
SplitterWindow's and they are not even splitted. I assure you that the same
is happening in those cases. I am not invoking any Layout( ) here, but I've
tried that too.

Can anyone explain what is happening here? Am I missing a step somewhere?
Or could this actually be a bug in SplitterWindow?

Dan
Jul 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.