[wxPython] splitter refresh in a MDIChildFrame

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[wxPython] splitter refresh in a MDIChildFrame

Kevin A. White
I am dynamically creating a wxMDIChildFrame as needed for my application.
The child of this frame is to be a wxSplitterWindow, such that the
wxChildFrame has two panes. I am initializing the splitter in the __init__
of the wxChildFrame, but on initial creation the splitter only appears in
the top left corner of the wxChildFrame. I have to manually resize the
window for the splitter to resize to the size of the childframe. How can I
force the resize from inside the __init__? Refresh, Move, and Resize haven't
worked.  Thanks in advance.

Below is a snippet from my code:

class myMDIChildFrame( wxMDIChildFrame ):
   def __init__(self, parent ):
      wxMDIChildFrame.__init__(self, parent, -1, "Some Title" )

      splitter = wxSplitterWindow(self, -1)
      w1 = wxWindow(splitter, -1)
      w2 = wxWindow(splitter, -1)
      splitter.SplitVertically( w1, w2, 100 )


_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

Re: [wxPython] splitter refresh in a MDIChildFrame

Robin Dunn
> I am dynamically creating a wxMDIChildFrame as needed for my application.
> The child of this frame is to be a wxSplitterWindow, such that the
> wxChildFrame has two panes. I am initializing the splitter in the __init__
> of the wxChildFrame, but on initial creation the splitter only appears in
> the top left corner of the wxChildFrame. I have to manually resize the
> window for the splitter to resize to the size of the childframe. How can I
> force the resize from inside the __init__? Refresh, Move, and Resize
haven't
> worked.  Thanks in advance.
>

I think this bug has just been fixed recently in the C++ code, you might try
the interim build that was just uploaded last night.

In the meantime, this is something I've done before to force a resize event:

    size = self.GetSize()
    size.width = size.width-1
    self.SetSize(size)


--
Robin Dunn
Software Craftsman
[hidden email]
http://AllDunn.com/robin/
http://AllDunn.com/wxPython/  Check it out!



_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users