wxPython笔记:窗口添加滚动条
转载:https://www.cnblogs.com/evilloop/archive/2013/01/30/2883838.html wxpython的默认窗体类wx.Frame并不带滚动条 如果需要滚动条,需要在初始化的时候进行设定 下边是一个示例: #coding=utf8 import wx class MsgWindow(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title, pos=(640,0)) #重要的就下边两句 self.scroller = wx.ScrolledWindow(self, -1) self.scroller.SetScrollbars(1, 1, 1440, 900) self.pnl = pnl = wx.Panel(self.scroller) self.ms = ms = wx.BoxSizer(wx.VERTICAL) self.SetMinSize((300,640)) self.pnl.SetSizer(self.ms) self.ms.Fit(self) if __name__ == '__main__': app = wx.App(redirect=False) msg_win = MsgWindow