[Python] python使用wxpython的 wx.aui 进行布局 →→→→→进入此内容的聊天室

来自 , 2019-04-14, 写在 Python, 查看 137 次.
URL http://www.code666.cn/view/ea20aed6
  1. # -*- coding: cp936 -*-
  2. # 2010-04-20 18:40 中国广州天河
  3. # 如何实现动态布局
  4. # source:http://stackoverflow.com/questions/523363/how-do-i-layout-a-3-pane-window-using-wxpython
  5. import wx
  6. import wx.aui
  7.  
  8. class MyFrame(wx.Frame):
  9. def __init__(self, *args, **kwargs):
  10. wx.Frame.__init__(self, *args, **kwargs)
  11.  
  12. self.mgr = wx.aui.AuiManager(self)
  13.  
  14. leftpanel = wx.Panel(self, -1, size = (200, 150))
  15. rightpanel = wx.Panel(self, -1, size = (200, 150))
  16. bottompanel = wx.Panel(self, -1, size = (200, 150))
  17.  
  18. self.mgr.AddPane(leftpanel, wx.aui.AuiPaneInfo().Bottom())
  19. self.mgr.AddPane(rightpanel, wx.aui.AuiPaneInfo().Left().Layer(1))
  20. self.mgr.AddPane(bottompanel, wx.aui.AuiPaneInfo().Center().Layer(2))
  21.  
  22. self.mgr.Update()
  23.  
  24. class MyApp(wx.App):
  25. def OnInit(self):
  26. frame = MyFrame(None, -1, '使用ax.aui')
  27. frame.Show()
  28. self.SetTopWindow(frame)
  29. return 1
  30.  
  31. app = MyApp(0)
  32. app.MainLoop()
  33. #//python/2007

回复 "python使用wxpython的 wx.aui 进行布局"

这儿你可以回复上面这条便签

captcha