Scrollbars lock up on ScrolledPanel

My problem is that the bars in a ScrolledPanel() lock up and prevent
scrolling. It happens when the text changes to become both too wide
and too tall for the window. If the text is merely too wide, then the
scrollbar works fine. I've tried everything I think is obvious, such
a Fit(), Layout(), SetupScrolling(), and combinations of the three.

As always, my question is what am I doing wrong here?

My small example
(http://www.daniweb.com/software-development/python/threads/177558
with a couple lines changed):

import wx
import wx.lib.scrolledpanel as scrolled

class TestPanel(scrolled.ScrolledPanel):
  def __init__(self, parent):
    scrolled.ScrolledPanel.__init__(self, parent, -1)

    vbox = wx.BoxSizer(wx.VERTICAL)
    desc = wx.StaticText(self, -1, "test" )
    desc.SetForegroundColour("Blue")
    vbox.Add(desc, 0, wx.ALIGN_LEFT|wx.ALL, 5)
    self.SetSizer(vbox)
    self.SetAutoLayout(1)
    self.SetupScrolling()
    self.text = desc

app = wx.App(0)
frame = wx.Frame(None, wx.ID_ANY)
fa = TestPanel(frame)
frame.Show()
fa.text.SetLabel( "ScrolledPanel extends wx.ScrolledWindow, adding all "
    "the necessary bits to set up scroll handling for you.\n\n"
    "Here are three fixed size examples of its use. The "
    "demo panel for this sample is also using it -- the \nwxStaticLine "
    "below is intentionally made too long so a scrollbar will be "
    "activated." * 10 )
app.MainLoop()

···

--
-- Schlake

Platform and version?

···

On 9/17/11 8:46 PM, William D. Colburn (Schlake) wrote:

My problem is that the bars in a ScrolledPanel() lock up and prevent
scrolling. It happens when the text changes to become both too wide
and too tall for the window. If the text is merely too wide, then the
scrollbar works fine. I've tried everything I think is obvious, such
a Fit(), Layout(), SetupScrolling(), and combinations of the three.

As always, my question is what am I doing wrong here?

--
Robin Dunn
Software Craftsman

Don't know as your code works for me, both on Py 2.6.6 wxPython 2.8.12.1 on Ubuntu and Py 2.7, wxPython 2.9.2.4 on Windows 7.

it still works after I change the "*10" to "*30".

Werner

···

On 09/18/2011 05:46 AM, William D. Colburn (Schlake) wrote:

My problem is that the bars in a ScrolledPanel() lock up and prevent
scrolling. It happens when the text changes to become both too wide
and too tall for the window. If the text is merely too wide, then the
scrollbar works fine. I've tried everything I think is obvious, such
a Fit(), Layout(), SetupScrolling(), and combinations of the three.

As always, my question is what am I doing wrong here?

Your code snippet does work on my computer under
WinXp and Win7
wx.Python 2.8

···

Am 18.09.11 05:46, schrieb William D. Colburn (Schlake):

My problem is that the bars in a ScrolledPanel() lock up and prevent
scrolling. It happens when the text changes to become both too wide
and too tall for the window. If the text is merely too wide, then the
scrollbar works fine. I've tried everything I think is obvious, such
a Fit(), Layout(), SetupScrolling(), and combinations of the three.

As always, my question is what am I doing wrong here?

My small example
(How do i use the wxpython.scrolledPanel ... [SOLVED] | DaniWeb
with a couple lines changed):

import wx
import wx.lib.scrolledpanel as scrolled

class TestPanel(scrolled.ScrolledPanel):
  def __init__(self, parent):
    scrolled.ScrolledPanel.__init__(self, parent, -1)

    vbox = wx.BoxSizer(wx.VERTICAL)
    desc = wx.StaticText(self, -1, "test" )
    desc.SetForegroundColour("Blue")
    vbox.Add(desc, 0, wx.ALIGN_LEFT|wx.ALL, 5)
    self.SetSizer(vbox)
    self.SetAutoLayout(1)
    self.SetupScrolling()
    self.text = desc

app = wx.App(0)
frame = wx.Frame(None, wx.ID_ANY)
fa = TestPanel(frame)
frame.Show()
fa.text.SetLabel( "ScrolledPanel extends wx.ScrolledWindow, adding all "
    "the necessary bits to set up scroll handling for you.\n\n"
    "Here are three fixed size examples of its use. The "
    "demo panel for this sample is also using it -- the \nwxStaticLine "
    "below is intentionally made too long so a scrollbar will be "
    "activated." * 10 )
app.MainLoop()

--
--------------------------------------------------
Tobias Weber
CEO

The ROG Corporation GmbH
Donaustaufer Str. 200
93059 Regensburg
Tel: +49 941 4610 57 55
Fax: +49 941 4610 57 56

www.roglink.com

GeschŠftsfŸhrer: Tobias Weber
Registergericht: Amtsgericht Regensburg - HRB 8954
UStID DE225905250 - Steuer-Nr.184/59359
--------------------------------------------------

Sorrry, still macos, py 2.7.1, 2.9.2.4 osx-cocoa (classic)

···

On Sun, Sep 18, 2011 at 2:09 AM, Robin Dunn <robin@alldunn.com> wrote:

On 9/17/11 8:46 PM, William D. Colburn (Schlake) wrote:

My problem is that the bars in a ScrolledPanel() lock up and prevent
scrolling. It happens when the text changes to become both too wide
and too tall for the window. If the text is merely too wide, then the
scrollbar works fine. I've tried everything I think is obvious, such
a Fit(), Layout(), SetupScrolling(), and combinations of the three.

As always, my question is what am I doing wrong here?

Platform and version?

--
Robin Dunn
Software Craftsman
http://wxPython.org

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

--
-- Schlake

[This group prefers bottom-posting.]

···

On 9/18/11 7:43 AM, William D. Colburn (Schlake) wrote:

On Sun, Sep 18, 2011 at 2:09 AM, Robin Dunn<robin@alldunn.com> wrote:

On 9/17/11 8:46 PM, William D. Colburn (Schlake) wrote:

My problem is that the bars in a ScrolledPanel() lock up and prevent
scrolling. It happens when the text changes to become both too wide
and too tall for the window. If the text is merely too wide, then the
scrollbar works fine. I've tried everything I think is obvious, such
a Fit(), Layout(), SetupScrolling(), and combinations of the three.

As always, my question is what am I doing wrong here?

Platform and version?

Sorrry, still macos, py 2.7.1, 2.9.2.4 osx-cocoa (classic)

In that case it is a known problem. See wxTrac has been migrated to GitHub Issues - wxWidgets. In a nutshell, the problem is that the static texts are layered above the scrollbars, so they are getting the mouse events.

--
Robin Dunn
Software Craftsman

I usually remember that just after I hit send.

I had thought I was just using it wrong, but I guess not. And I've
tried a variety of things to work around it to no luck so I think I'm
stuck with it.

-- Schlake

···

On Sun, Sep 18, 2011 at 2:04 PM, Robin Dunn <robin@alldunn.com> wrote:

[This group prefers bottom-posting.]