wxFormBuilder + python + wxWidget
-------------
# -*- coding: utf-8 -*- ########################################################################### ## Python code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3) ## http://www.wxformbuilder.org/ ## ## PLEASE DO *NOT* EDIT THIS FILE! ########################################################################### import wx import wx.xrc import wx.lib.agw.ribbon as rb wx.ID_MAIN_FRAME = 1000 ########################################################################### ## Class MainFrame ########################################################################### class MainFrame ( wx.Frame ): def __init__( self, parent ): wx.Frame.__init__ ( self, parent, id = wx.ID_MAIN_FRAME, title = u"主窗体", pos = wx.DefaultPosition, size = wx.Size( 857,600 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL ) self.SetSizeHints( wx.DefaultSize, wx.DefaultSize ) self.m_statusBar2 = self.CreateStatusBar( 1, wx.STB_SIZEGRIP, wx.ID_ANY ) bSizer10 = wx.BoxSizer( wx.VERTICAL ) self.m_ribbonBar7 = rb.RibbonBar( self , wx.ID_ANY, wx.DefaultPosition, wx.Size( -1,-1 ), wx.lib.agw.ribbon.RIBBON_BAR_DEFAULT_STYLE ) self.m_ribbonPage9 = rb.RibbonPage( self.m_ribbonBar7, wx.ID_ANY, u"MyRibbonPage" , wx.NullBitmap , 0 ) self.m_ribbonPanel8 = rb.RibbonPanel( self.m_ribbonPage9, wx.ID_ANY, u"MyRibbonPanel" , wx.NullBitmap , wx.DefaultPosition, wx.DefaultSize, wx.lib.agw.ribbon.RIBBON_PANEL_DEFAULT_STYLE ) self.m_ribbonButtonBar1 = rb.RibbonButtonBar( self.m_ribbonPanel8, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0) self.m_ribbonButtonBar1.AddSimpleButton( wx.ID_ANY, u"MyRibbonButton", wx.NullBitmap, wx.EmptyString) self.m_ribbonButtonBar1.AddSimpleButton( wx.ID_ANY, u"MyRibbonButton", wx.NullBitmap, wx.EmptyString) self.m_ribbonButtonBar1.AddSimpleButton( wx.ID_ANY, u"MyRibbonButton", wx.NullBitmap, wx.EmptyString) self.m_ribbonPage10 = rb.RibbonPage( self.m_ribbonBar7, wx.ID_ANY, u"MyRibbonPage" , wx.NullBitmap , 0 ) self.m_ribbonPanel9 = rb.RibbonPanel( self.m_ribbonPage10, wx.ID_ANY, u"MyRibbonPanel" , wx.NullBitmap , wx.DefaultPosition, wx.DefaultSize, wx.lib.agw.ribbon.RIBBON_PANEL_DEFAULT_STYLE ) self.m_ribbonPage11 = rb.RibbonPage( self.m_ribbonBar7, wx.ID_ANY, u"MyRibbonPage" , wx.NullBitmap , 0 ) self.m_ribbonPanel10 = rb.RibbonPanel( self.m_ribbonPage11, wx.ID_ANY, u"MyRibbonPanel" , wx.NullBitmap , wx.DefaultPosition, wx.DefaultSize, wx.lib.agw.ribbon.RIBBON_PANEL_DEFAULT_STYLE ) self.m_ribbonPage12 = rb.RibbonPage( self.m_ribbonBar7, wx.ID_ANY, u"MyRibbonPage" , wx.NullBitmap , 0 ) self.m_ribbonBar7.Realize() bSizer10.Add( self.m_ribbonBar7, 0, wx.EXPAND, 0 ) self.m_panel6 = wx.Panel( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL ) self.m_panel6.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_GRAYTEXT ) ) bSizer10.Add( self.m_panel6, 1, wx.EXPAND |wx.ALL, 0 ) self.SetSizer( bSizer10 ) self.Layout() self.Centre( wx.BOTH ) def __del__( self ): pass #导入wx包 app = wx.App() #创建应用程序对象 win = MainFrame(wx.Frame(None,-1,'install test')) #创建窗体 #btn = wx.Button(win, label = 'Button') #创建Button win.Show() #显示窗体 app.MainLoop() #运行程序
-----------------