[wxPython-users] wx.SashLayoutWindow + wx.Notebook

Josiah Carlson jcarlson at uci.edu
Mon Oct 2 11:15:07 PDT 2006


Robin Dunn <robin at alldunn.com> wrote:
> 
> Josiah Carlson wrote:
> > When combining a wx.SashLayoutWindow with a wx.Notebook (notebook is a
> > child of the SLW, not the client area), in Python 2.4.3, wxPython
> > 2.6.3.3, wxGTK 2.6.3.3 (according to synaptic) on Ubuntu, moving the
> > mouse over notebook tabs after moving the mouse over the sash, causes
> > the mouse to always be in the 'resize' cursor when over the notebook
> > tabs.  Attached you will find a portion of screenshot of this happening,
> > along with the script used to generate the screenshot.
> 
> It appears that it is not getting the leave window event in that case, 
> or something like that.  You can work around this by putting the panel 
> between the notebook and the SashLayoutWindow.
> 
>          # for notebook test
>          p = wx.Panel(slw)
>          x = wx.Notebook(p, -1)
>          def nb_size(evt):
>              sz = evt.GetSize()
>              x.SetDimensions(0,0, sz.width, sz.height)
>          p.Bind(wx.EVT_SIZE, nb_size)

That works too.  I ended up switching to SplitterWindows and using
SW.SetSashGravity() to get the auto sash sizing I wanted.  As a bonus,
I'm also able to switch windows with the SplitterWindow variant without
jumping through (many) hoops.


> > Related to this, I have discovered that in certain cases, having a
> > ScrolledPanel inside a SashLayoutWindow causes the ScrolledPanel to be
> > confused about its size and where scrollbars should be.  
> 
> If you have time I'd really like to see a sample that replicates this 
> problem so I can dig into it and figure out what is going on.

The only place I've made it happen 'reliably' is within the 'search' tab
in PyPE.  Version 2.6.5 has the issue, available here:
http://prdownloads.sourceforge.net/pype/PyPE-2.6.5-src.zip?download ,
the relevant file being plugins/findinfiles.py .

I'm sorry I can't be more specific, I'll see if I can't narrow it down
in the next few days.

 - Josiah





More information about the wxpython-users mailing list