scrolled window showing bottom of the window also showing scroll bars at the bottom

I am scrolled window showing bottom of the window so scroll bars coming at the bottom. i want them at vertical top position
Below is the code
I use wxPython 2.8.12.1 boa constructor 0.6.1 python 2.6.6 on windows 7

self.scrolledWindow1 = wx.ScrolledWindow(id=wxID_TESTMDICHILDFRAME2SCROLLEDWINDOW1,
name=‘scrolledWindow1’, parent=self, pos=wx.Point(5, 5),
size=wx.Size(800, 464),
style=wx.THICK_FRAME | wx.SUNKEN_BORDER | wx.CLIP_CHILDREN | wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX | wx.CAPTION | wx.HSCROLL | wx.VSCROLL)

def __init__(self, parent):
   self.bsPanelScrolledWin.Add(self.blankpanel1, 0, border=0, flag=0)   
    self.bsPanelScrolledWin.FitInside(self.scrolledWindow1)
    self.scrolledWindow1.SetSizer(self.bsPanelScrolledWin)
    self.unit=20
    widthPanel,heightPanel=self.panels[1].GetSizeTuple()
    self.scrolledWindow1.SetSize((widthPanel+20,heightPanel*3+40))
    self.SetSize((widthPanel+75,heightPanel*5))
    self.scrolledWindow1.SetScrollbars(self.unit, self.unit, widthPanel/self.unit, heightPanel*7/self.unit)
    #self.scrolledWindow1.Center()   
    self.scrolledWindow1.MakeModal(True)
    self.scrolledWindow1.Show(1)

can help me what’s the problem with this code

Sorry, I don't understand what it is that you want to do and what is not working. Please make a runnable and small as possible sample application that demonstrates the problem. MakingSampleApps - wxPyWiki

···

On 11/7/12 8:58 PM, Prashant Deshmukh wrote:

I am scrolled window showing bottom of the window so scroll bars coming
at the bottom. i want them at vertical top position
Below is the code
I use wxPython 2.8.12.1 boa constructor 0.6.1 python 2.6.6 on windows 7

self.scrolledWindow1 =
wx.ScrolledWindow(id=wxID_TESTMDICHILDFRAME2SCROLLEDWINDOW1,
               name='scrolledWindow1', parent=self, pos=wx.Point(5, 5),
               size=wx.Size(800, 464),
               style=wx.THICK_FRAME | wx.SUNKEN_BORDER |
wx.CLIP_CHILDREN | wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX | wx.CAPTION |
wx.HSCROLL | wx.VSCROLL)

     def __init__(self, parent):
        self.bsPanelScrolledWin.Add(self.blankpanel1, 0, border=0, flag=0)
         self.bsPanelScrolledWin.FitInside(self.scrolledWindow1)
         self.scrolledWindow1.SetSizer(self.bsPanelScrolledWin)
         self.unit=20
         widthPanel,heightPanel=self.panels[1].GetSizeTuple()
         self.scrolledWindow1.SetSize((widthPanel+20,heightPanel*3+40))
         self.SetSize((widthPanel+75,heightPanel*5))
         self.scrolledWindow1.SetScrollbars(self.unit, self.unit,
widthPanel/self.unit, heightPanel*7/self.unit)
         #self.scrolledWindow1.Center()
         self.scrolledWindow1.MakeModal(True)
         self.scrolledWindow1.Show(1)

can help me what's the problem with this code

--
Robin Dunn
Software Craftsman

I have added number on panels on on Scrolledpanel. So scrolled panel was showing last panel while populating that GUI and so the vertical scroll bars were appearing at botton instead of top. This was coming from the features of ScrolledPanel that focus was getting set at last child panel.
Actually i wanted scrolled panel should show first child panel and so scroll bar should appear at vertical top position.
So i have just added this code
self.panels[1].SetFocus()

and it gave me what did I want.

···

On Friday, 9 November 2012 06:43:50 UTC+5:30, Robin Dunn wrote:

On 11/7/12 8:58 PM, Prashant Deshmukh wrote:

I am scrolled window showing bottom of the window so scroll bars coming

at the bottom. i want them at vertical top position

Below is the code

I use wxPython 2.8.12.1 boa constructor 0.6.1 python 2.6.6 on windows 7

self.scrolledWindow1 =

wx.ScrolledWindow(id=wxID_TESTMDICHILDFRAME2SCROLLEDWINDOW1,

           name='scrolledWindow1', parent=self, pos=wx.Point(5, 5),
           size=wx.Size(800, 464),
           style=wx.THICK_FRAME | wx.SUNKEN_BORDER |

wx.CLIP_CHILDREN | wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX | wx.CAPTION |

wx.HSCROLL | wx.VSCROLL)

 def __init__(self, parent):
    self.bsPanelScrolledWin.Add(self.blankpanel1, 0, border=0, flag=0)
     self.bsPanelScrolledWin.FitInside(self.scrolledWindow1)
     self.scrolledWindow1.SetSizer(self.bsPanelScrolledWin)
     self.unit=20
     widthPanel,heightPanel=self.panels[1].GetSizeTuple()
     self.scrolledWindow1.SetSize((widthPanel+20,heightPanel*3+40))
     self.SetSize((widthPanel+75,heightPanel*5))
     self.scrolledWindow1.SetScrollbars(self.unit, self.unit,

widthPanel/self.unit, heightPanel*7/self.unit)

     #self.scrolledWindow1.Center()
     self.scrolledWindow1.MakeModal(True)
     self.scrolledWindow1.Show(1)

can help me what’s the problem with this code

Sorry, I don’t understand what it is that you want to do and what is not
working. Please make a runnable and small as possible sample
application that demonstrates the problem.
http://wiki.wxpython.org/MakingSampleApps


Robin Dunn

Software Craftsman

http://wxPython.org