how can I make scroll in panel?

I make like this but when I move the vertical scrollbar, it scrolls
nothing.
how can I make working scroll?

class TestPanel(wx.Panel):
    def __init__(self, parent):
        wx.Panel.__init__(self, parent, -1)

        self.Autosizer = wx.FlexGridSizer(cols=2, hgap = -190, vgap =
-1)
        self.Autosizer.SetFlexibleDirection(wx.VERTICAL)

        self.scrolled_panel = scrolled.ScrolledPanel(self, -1,
                                 style = wx.TAB_TRAVERSAL|
wx.SUNKEN_BORDER, name="panel1")
        self.scrolled_panel.SetAutoLayout(1)
        self.scrolled_panel.SetupScrolling()

        self.scrolled_panel.SetSizer(self.Autosizer)

        panelSizer = wx.BoxSizer(wx.VERTICAL)
        panelSizer.Add(self.scrolled_panel, 1, wx.EXPAND)
# panelSizer.Add(btn)
        self.SetSizer(panelSizer)

what I want to do is :
when I move the scroll, the containers in flexGridSizer will be
scrolled.

Wonjun, Choi

What are you trying to accomplish with ", hgap = -190, vgap=-1)" on your sizer?

Your code doesn't show how you add controls to all this.

The code you have should work, so I suspect it is in your code where you add controls.

Attached a sample app based on your code with some additional stuff (less your hgap setting) showing that it works.

Werner

scrollpanel.py (1.47 KB)

···

On 10/28/2011 10:19 AM, Wonjun, Choi wrote:

I make like this but when I move the vertical scrollbar, it scrolls
nothing.
how can I make working scroll?

I make like this but when I move the vertical scrollbar, it scrolls
nothing.
how can I make working scroll?

what I want to do is :
when I move the scroll, the containers in flexGridSizer will be
scrolled.

Hi, I also struggled with that and what worked in the end for me is using wx.ScrolledWindow as opposed to a panel. This is the documentations which I was reading:
http://xoomer.virgilio.it/infinity77/wxPython/Widgets/wx.ScrolledWindow.html
To make the window scrollable, I used the command SetScrollRate as described in the third bullet at the top in the document above.
In addition, to set the size of the window (the actual window which appears on the screen with the scrollbars, and not the virtual window through which you are scrolling), I used the SetMinSize command on the ScrolledWindow.
Finally, in my case was populating the scrolled window with widgets during the program was running. In that case in order to show the widgets I used the Layout() command and afterwards FitInside as opposed to Fit in order to keep the same, as Fit will change the size of the scrolled window.
If the above explanation is confusing, you can send a simple and complete executable example script (not just a class) and I can take a closer look.

I see, thank you

Wonjun, Choi

···

2011/10/28 G. Nikiforov g_nikiforov@hotmail.com

I make like this but when I move the vertical scrollbar, it scrolls

nothing.
how can I make working scroll?

what I want to do is :

when I move the scroll, the containers in flexGridSizer will be
scrolled.

Hi, I also struggled with that and what worked in the end for me is using wx.ScrolledWindow as opposed to a panel. This is the documentations which I was reading:

http://xoomer.virgilio.it/infinity77/wxPython/Widgets/wx.ScrolledWindow.html
To make the window scrollable, I used the command SetScrollRate as described in the third bullet at the top in the document above.

In addition, to set the size of the window (the actual window which appears on the screen with the scrollbars, and not the virtual window through which you are scrolling), I used the SetMinSize command on the ScrolledWindow.

Finally, in my case was populating the scrolled window with widgets during the program was running. In that case in order to show the widgets I used the Layout() command and afterwards FitInside as opposed to Fit in order to keep the same, as Fit will change the size of the scrolled window.

If the above explanation is confusing, you can send a simple and complete executable example script (not just a class) and I can take a closer look.

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

btw, can I change the height of stc when I type text in it?
I want to delete the scroll of stc.
and when user type some text in stc, the stc’s height will be changed.

···

2011/10/29 최원준 wonjunchoi001@gmail.com

2011/10/28 G. Nikiforov g_nikiforov@hotmail.com

I make like this but when I move the vertical scrollbar, it scrolls

nothing.
how can I make working scroll?

what I want to do is :

when I move the scroll, the containers in flexGridSizer will be
scrolled.

Hi, I also struggled with that and what worked in the end for me is using wx.ScrolledWindow as opposed to a panel. This is the documentations which I was reading:

http://xoomer.virgilio.it/infinity77/wxPython/Widgets/wx.ScrolledWindow.html
To make the window scrollable, I used the command SetScrollRate as described in the third bullet at the top in the document above.

In addition, to set the size of the window (the actual window which appears on the screen with the scrollbars, and not the virtual window through which you are scrolling), I used the SetMinSize command on the ScrolledWindow.

Finally, in my case was populating the scrolled window with widgets during the program was running. In that case in order to show the widgets I used the Layout() command and afterwards FitInside as opposed to Fit in order to keep the same, as Fit will change the size of the scrolled window.

If the above explanation is confusing, you can send a simple and complete executable example script (not just a class) and I can take a closer look.

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

I see, thank you

Wonjun, Choi