wx.scrollbar

Newbie question How do I place a vscroll bar in mynote book …Im having a brain fart

class MainFrame(wx.Frame):
def init(self):
wx.Frame.init(self, None, title=“SEMS Event Managment Softewat ver1.0”,size=(1000, 700))
panel = wx.Panel(self, -1)
self.scroll = wx.ScrolledWindow(self, -1,style=wx.VSCROLL)
self.scroll.SetScrollbars(1, 1, 1000, 700)

self.registrychecker(self)
    self.statusbar = self.CreateStatusBar()
    self.statusbar.SetFieldsCount(3)
    self.statusbar.SetStatusWidths([-1, -2, -3])
   

   
    menu = wx.Menu("SEMS Patient Reporting Software ver 1.0")

    menuBar = wx.MenuBar()
    simple = menu.Append(-1, "SEMS Patient Reporting Software")
   

    menu.AppendSeparator()
   

    self.nb = wx.Notebook(panel)

 

    self.p1 = page1.PageOne(self.nb)
    self.p2 = page2.PageTwo(self.nb)
    self.p3 = page3.PageThree(self.nb)
    self.p4 = page4.PageFour(self.nb)
    self.p5 = page5.PageFive(self.nb)
    self.p6 = page6.PageSix(self.nb)
    self.p7 = page7.PageSeven(self.nb)

    # add the pages to the notebook with the label to show on the tab
    self.nb.AddPage(self.p1, "PrePlanning Step 1")
    self.nb.AddPage(self.p2, "PrePlanning Step 2")
    self.nb.AddPage(self.p3, "PrePlanning Step 3")
    self.nb.AddPage(self.p4, "PrePlanning Step 4")
    self.nb.AddPage(self.p5, "Preplanning Step 5")
    self.nb.AddPage(self.p6, "Preplanning step 6")
    self.nb.AddPage(self.p7, "Preplanning Step 7")

    vbox = wx.BoxSizer(wx.VERTICAL)

    hbox1 = wx.BoxSizer(wx.HORIZONTAL)
    st1 = wx.StaticText(panel, -1, 'Event Name:')
    hbox1.Add(st1, 0, wx.RIGHT, 8)
    self.eventBox = wx.Choice(panel, -1)
    self.eventBox.SetSizeHints(200,-1,200,-1)
    hbox1.Add(self.eventBox, 1)
    vbox.Add(hbox1, 0, wx.CENTER | wx.LEFT | wx.RIGHT | wx.TOP, 10)

    vbox.Add((-1, 10))

    hbox3 = wx.BoxSizer(wx.HORIZONTAL)
    hbox3.Add(self.nb, 1, wx.EXPAND)
    vbox.Add(hbox3, 1, wx.LEFT | wx.RIGHT | wx.EXPAND, 10)

    vbox.Add((-1, 8))
   
    hbox5 = wx.BoxSizer(wx.HORIZONTAL)
    self.saveButton = wx.Button(panel, -1, 'Save', size=(70, 30))
    hbox5.Add(self.saveButton, 0)
    hbox5.Add((25,-1))
    self.updateButton = wx.Button(panel, -1, 'Update', size=(70, 30))
    hbox5.Add(self.updateButton, 0)
    hbox5.Add((25,-1))
    self.exportButton = wx.Button(panel, -1, 'Export', size=(70, 30))
    hbox5.Add(self.exportButton, 0)
    hbox5.Add((25,-1))
    #self.printButton = wx.Button(panel, -1, 'Print', size=(70, 30))
    #hbox5.Add(self.printButton, 0)
    #hbox5.Add((25,-1))
    self.emailButton = wx.Button(panel, -1, 'Email', size=(70, 30))
    hbox5.Add(self.emailButton, 0)
    vbox.Add(hbox5, 0, wx.ALIGN_CENTER | wx.CENTER, 10)
   
   
    #bind events
    self.eventBox.Bind(wx.EVT_CHOICE, self.onEventRoll)
    self.saveButton.Bind(wx.EVT_BUTTON, self.onSave)
    self.updateButton.Bind(wx.EVT_BUTTON, self.onUpdate)
    self.exportButton.Bind(wx.EVT_BUTTON, self.onExport)
    #self.printButton.Bind(wx.EVT_BUTTON, self.onPrint)
    self.emailButton.Bind(wx.EVT_BUTTON, self.onEmail)
    self.nb.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED, self.refresh)
   
    panel.SetSizer(vbox)
   
    #update choice widget
    self.currentTable = None
    #self.eventBox
    self.updateChoice()

/me opens window and waves hands around...

You should just need to create a wx.ScrolledWindow and use that as the notebook page instead of a wx.Panel or whatever you are using. Call the scrolled window's SetScrollRate method and then whenever the virtual size is greater than the client size the scrollbar will be shown.

···

On 7/22/12 1:11 PM, aikidoguy wrote:

Newbie question How do I place a vscroll bar in mynote book ...Im having
a brain fart

--
Robin Dunn
Software Craftsman