scrolling events question

Hello Rob,

I have a scrolled panel that has various panels inside it

which in turn

contain various controls such as TextCtrls and buttons.

When I manually

scroll the window down, I am getting some strange

behavior. If I click on

the controls inside of one of the panels, the

scrolled panel automatically

scrolls to the top and my control (let's

say it's a button) does not fire.

However, when I scroll back down,

the button has focus and a subsequent

click will fire the button . but

then the scrolled panel automatically

scrolls to the top again. I

would like the control to fire the first time I

click it and for the

window not to auto scroll to the top.

Have you tried to subclass wx.
lib.scrolledpanel and then override the onChildFocus() method? I'm not
sure to remember correctly, but this should do the job. Something along
the lines:

import wx.lib.scrolledpanel as scrolled

class
MyScrolledPanel(scrolled.ScrolledPanel):

    def __init__(self,
parent, whatever)_

        scrolled.ScrolledPanel.__init__(self,
parent, whatever)
        
    def onChildFocus(self, event):

pass

Then you use the scrolledpanel in your app as MyScrolledPanel.
Not sure I remember correctly, but it should work.

HTH.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."

http://xoomer.virgilio.it/infinity77

Awesome, this did the trick. Thx a lot Andrea

ยทยทยท

-----Original Message-----
From: andrea_gavana@tin.it [mailto:andrea_gavana@tin.it]
Sent: Monday, September 19, 2005 1:44 PM
To: wxPython-users@lists.wxwidgets.org
Subject: [wxPython-users] R: [wxPython-users] scrolling events question

Hello Rob,

I have a scrolled panel that has various panels inside it

which in turn

contain various controls such as TextCtrls and buttons.

When I manually

scroll the window down, I am getting some strange

behavior. If I click on

the controls inside of one of the panels, the

scrolled panel automatically

scrolls to the top and my control (let's

say it's a button) does not fire.

However, when I scroll back down,

the button has focus and a subsequent

click will fire the button . but

then the scrolled panel automatically

scrolls to the top again. I

would like the control to fire the first time I

click it and for the

window not to auto scroll to the top.

Have you tried to subclass wx.
lib.scrolledpanel and then override the onChildFocus() method? I'm not
sure to remember correctly, but this should do the job. Something along
the lines:

import wx.lib.scrolledpanel as scrolled

class
MyScrolledPanel(scrolled.ScrolledPanel):

    def __init__(self,
parent, whatever)_

        scrolled.ScrolledPanel.__init__(self,
parent, whatever)
        
    def onChildFocus(self, event):

pass

Then you use the scrolledpanel in your app as MyScrolledPanel.
Not sure I remember correctly, but it should work.

HTH.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."

http://xoomer.virgilio.it/infinity77

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org