wxPython多个窗口的基本结构

如何在一个wxpython APP里面创建两个框架呢?

代码:

import ...
import ...

class MyFrame(wx.Frame):
  def __init__(self):
    wx.Frame.__init__(
...

class MyFrame2(wx.Frame):
  def __init__(self):
    wx.Frame.__init__(
...

class MyApp(wx.App):
  def OnInit(self):
    self.myframe = MyFrame()
    self.myframe2 = MyFrame2()
    self.SetTopWindow(self.myframe)
    self.myframe.Show(True)
    self.myframe2.Show(True)
    return True

if __name__=='__main__':
  app = MyApp(0)
  app.MainLoop()
已标记关键词 清除标记
©️2020 CSDN 皮肤主题: Age of Ai 设计师:meimeiellie 返回首页