2007年09月03日 星期一 11:28
from wx import * class MainFrame(wx.Frame): def __init__(self,parent,id,title): wx.Frame.__init__(self,parent,id,title,style=wx.DEFAULT_FRAME_STYLE^wx.MAXIMIZE_BOX|wx.FRAME_NO_TASKBAR) panel=wx.Panel(self,-1) item0 = wx.BoxSizer( wx.HORIZONTAL ) item1 = wx.BoxSizer( wx.VERTICAL ) item3 = wx.GridSizer( 0, 2, 0, 0 ) self.btRun = wx.Button( panel, -1, u"run", wx.DefaultPosition, wx.DefaultSize, 0 ) item3.Add( self.btRun, 0, wx.ALIGN_CENTER|wx.ALL, 0 ) item1.Add(item3, 0, wx.ALIGN_CENTER, 0) item0.Add( item1, 0, wx.ALIGN_CENTER|wx.ALL, 5 ) panel.SetSizer( item0 ) class App(wx.App): def OnInit(self): self.main = MainFrame(None, 1, 'title') self.main.Show() self.SetTopWindow(self.main) return True def main(): application = App(0) application.MainLoop() if __name__ == '__main__': main() ----- ÔʼÓʼþ ---- ·¢¼þÈË£º vsmb <vsmb在21cn.com> ÊÕ¼þÈË£º python-chinese <python-chinese在lists.python.cn> ÒÑ·¢ËÍ£º 2007/9/3(ÖÜÒ»), ÉÏÎç12:10:09 Ö÷Ì⣺ [python-chinese] Çë½ÌwxpythonµÄpanelÎÊÌâ class MainFrame(wx.Frame): def __init__(self,parent,id,title): wx.Frame.__init__(self,parent,id,title,style=wx.DEFAULT_FRAME_STYLE^wx.MAXIMIZE_BOX|wx.FRAME_NO_TASKBAR) topSizer=BoxSizer( wx.HORIZONTAL ) panel=wx.Panel(self,-1) item0 = wx.BoxSizer( wx.HORIZONTAL ) item1 = wx.BoxSizer( wx.VERTICAL ) item3 = wx.GridSizer( 0, 2, 0, 0 ) self.btRun = wx.Button( self, -1, u"ÔËÐÐ", wx.DefaultPosition, wx.DefaultSize, 0 ) item3.Add( self.btRun, 0, wx.ALIGN_CENTER|wx.ALL, 0 ) item1.Add(item3, 0, wx.ALIGN_CENTER, 0) item0.Add( item1, 0, wx.ALIGN_CENTER|wx.ALL, 5 ) panel.SetSizer(item0) topSizer.Add(panel, 0,wx.EXPAND, 0) self.SetSizer( topSizer ) topSizer.Fit(self) ·¢ÏÖÎÞ·¨ÏÔʾ°´Å¥£¬Õû¸öitem3µÄ¶«Î÷¶¼²»ÄÜÏÔʾ¡«¡«¡«²»ÖªºÎ½â vsmb 2007-09-03 ___________________________________________________________ ÑÅ»¢ÓÊÏ䣬ÒÔ°²È«Öø³Æ£¬ÊÇÖµµÃÐÅÀµµÄÓÊÏäר¼Ò£¡ http://mail.yahoo.com.cn/ -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070903/e36ede28/attachment.htm
Zeuux © 2025
京ICP备05028076号