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

45 views
Skip to first unread message

Prashant Deshmukh

unread,
Nov 7, 2012, 11:58:50 PM11/7/12
to wxpytho...@googlegroups.com
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

unread,
Nov 8, 2012, 8:13:45 PM11/8/12
to wxpytho...@googlegroups.com
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

Prashant Deshmukh

unread,
Dec 13, 2012, 5:05:10 AM12/13/12
to wxpytho...@googlegroups.com
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.



Reply all
Reply to author
Forward
0 new messages