wx.lib.scrolledpanel scroll problem

Hi,
    I've noted that wx.lib.scrolledpanel ( very nice object!! ) don't works properly.

If I add some objects into scrolled panel, and, on button click, I want scroll at the end of scrolled panel, It doesn't works!!
Anyone can tell me why?

thx very much

···

--
/\/\ariano Di Felice
Java/PHP/Python WEB/GUI Developer
http://www.marianodifelice.it
mariano.difelice@gmail.com
Tel. 0735 703735
Cell +39 339 6407211

Hi Mariano,

···

On 8/20/08, Mariano Di Felice wrote:

  I've noted that wx.lib.scrolledpanel ( very nice object!! ) don't works
properly.

If I add some objects into scrolled panel, and, on button click, I want
scroll at the end of scrolled panel, It doesn't works!!
Anyone can tell me why?

In which sense "it doesn't work"? How are you trying to scroll at the
end? Can you show some simple code that reproduces the problem you are
having?

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

Sure Andrea,

I have some object into scrolled panel, and all it's ok!

When I click a button, I want insert another object into scrolled panel:

    b = Bordo(self)

    self.box.Add( b, 1, wx.EXPAND|wx.ALL, 2 )

    self.box.Layout()

    self.SetupScrolling()

self.box is a BoxSizer(wx.VERTICAL), SELF is refered to a class
MyClass(wx.lib.scrolledPanel.ScrolledPanel) and Bordo is a normal
wx.Panel class

Naturally, after added new object, I would like scroll to last
position, but

self.ScrollChildIntoView(b) doesn’t works, and self.Scroll(0, 1000)
doesn’t works too.

I don’t know why…

Thx Andrea

Andrea Gavana ha scritto:

···

http://xoomer.alice.it/infinity77/wxpython-users@lists.wxwidgets.orghttp://lists.wxwidgets.org/mailman/listinfo/wxpython-users

//\ariano Di Felice

Java/PHP/Python WEB/GUI Developer

Tel. 0735 703735
Cell +39 339 6407211

http://www.marianodifelice.it
mariano.difelice@gmail.com

Hi Mariano,

When I click a button, I want insert another object into scrolled panel:

        b = Bordo(self)
        self.box.Add( b, 1, wx.EXPAND|wx.ALL, 2 )
        self.box.Layout()
        self.SetupScrolling()

self.box is a BoxSizer(wx.VERTICAL), SELF is refered to a class
MyClass(wx.lib.scrolledPanel.ScrolledPanel) and Bordo is a
normal wx.Panel class
Naturally, after added new object, I would like scroll to last position, but
self.ScrollChildIntoView(b) doesn't works, and self.Scroll(0, 1000) doesn't
works too.

Uhm, I can only guess what's happening as your code can not be run as
it is... have you tried using something like:

wx.CallAfter(self.ScrollChildIntoView, b)

Or:

wx.CallLater(100, self.ScrollChildIntoView, b)

? Otherwise, please try to create a small runnable sample that
reproduces the problem.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On 8/20/08, Mariano Di Felice wrote:

Mariano Di Felice wrote:

Sure Andrea,
    I have some object into scrolled panel, and all it's ok!

When I click a button, I want insert another object into scrolled panel:

        b = Bordo(self)
        self.box.Add( b, 1, wx.EXPAND|wx.ALL, 2 )
        self.box.Layout()
        self.SetupScrolling()

self.box is a BoxSizer(wx.VERTICAL), SELF is refered to a class MyClass(wx.lib.scrolledPanel.ScrolledPanel) and Bordo is a normal wx.Panel class
Naturally, after added new object, I would like scroll to last position, but
self.ScrollChildIntoView(b) doesn't works, and self.Scroll(0, 1000) doesn't works too.

I don't know why....

SetupScrolling will scroll to the top when it is done. That was formerly a side-effect of its implementation, but starting in 2.8.8.1 it is a default but optional behavior. You can pass scrollToTop=False to avoid scrolling.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Mariano,

Are you forgetting to call self.FitInside(), which forces the sizer to
set the scrolled window's virtual size, which is what triggers the
scrollbars to be shown? This works for me.

TomH

···

On Thu, Aug 21, 2008 at 5:20 PM, Robin Dunn <robin@alldunn.com> wrote:

Mariano Di Felice wrote:

Sure Andrea,
   I have some object into scrolled panel, and all it's ok!

When I click a button, I want insert another object into scrolled panel:

       b = Bordo(self)
       self.box.Add( b, 1, wx.EXPAND|wx.ALL, 2 )
       self.box.Layout()
       self.SetupScrolling()

self.box is a BoxSizer(wx.VERTICAL), SELF is refered to a class
MyClass(wx.lib.scrolledPanel.ScrolledPanel) and Bordo is a normal wx.Panel
class
Naturally, after added new object, I would like scroll to last position,
but
self.ScrollChildIntoView(b) doesn't works, and self.Scroll(0, 1000)
doesn't works too.

I don't know why....

SetupScrolling will scroll to the top when it is done. That was formerly a
side-effect of its implementation, but starting in 2.8.8.1 it is a default
but optional behavior. You can pass scrollToTop=False to avoid scrolling.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

--

Tom Harris <celephicus@gmail.com>

Well, dear people,

I've found a solution ( thanks to Andrea Gavana ).

I have implemented a method

def later():

self.ScrollTo(0, 100)

wx.CallAfter(later)

And now it works fine!

With this solution, method ScrollChildIntoView works too!!!

thx bye

Tom Harris ha scritto:

···

robin@alldunn.comhttp://wxPython.orgwxpython-users@lists.wxwidgets.orghttp://lists.wxwidgets.org/mailman/listinfo/wxpython-users

//\ariano Di Felice

Java/PHP/Python WEB/GUI Developer

Tel. 0735 703735
Cell +39 339 6407211

http://www.marianodifelice.it
mariano.difelice@gmail.com