I am trying to add a vertical scroll bar to one of my notebook tabs using wxPython. I have tried adding the window style wx.VSCROLL to a few different panels and I am not getting any luck. Here is my code:
import wx
import os
class MyFrame(wx.Frame):
def __init__(self, parent, ID, title):
wx.Frame.__init__(self, parent, ID, title=title, size=(500,200))
main = wx.Panel(self)
nb = wx.Notebook(main)
loginPg = wx.Panel(nb)
entryPg = wx.Panel(nb, style=wx.VSCROLL) //<--- This kind of works
projectsPg = wx.Panel(nb)
nb.AddPage(loginPg, "Login")
nb.AddPage(entryPg, "Entry")
nb.AddPage(projectsPg, "Projects")
self.entTitle = titlePanel(entryPg, -1)
self.entLabel = labelPanel(entryPg, -1)
self.entDescription = descrPanel(entryPg, -1)
mainSizer = wx.BoxSizer(wx.VERTICAL)
entryPgBox = wx.BoxSizer(wx.VERTICAL)
mainSizer.Add(nb, 1, wx.ALL|wx.EXPAND)
entryPgBox.Add(self.entTitle, 0, wx.EXPAND)
entryPgBox.Add(self.entLabel, 0, wx.EXPAND)
entryPgBox.Add(self.entDescription, 0, wx.EXPAND)
entryPg.SetAutoLayout(True)
entryPg.SetSizer(entryPgBox)
entryPgBox.Fit(entryPg)
main.SetAutoLayout(True)
main.SetSizer(mainSizer)
mainSizer.Fit(main)
self.Layout()
self.Show()
app = wx.App(False)
frame = MyFrame(None, -1, 'Test')
frame.Show()
app.MainLoop()
My goal is to have the second tab "Entry" of my notebook vertically scrollable. By adding style=wx.VSCROLL to entryPg I get a scrollbar for that tab but it will not scroll down. How do I get my Notebook Tab entryPg to have a vertical scrollbar that will scroll down? Any help is greatly appreciated!