Chinaunix首页 | 论坛 | 博客
  • 博客访问: 266943
  • 博文数量: 103
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 705
  • 用 户 组: 普通用户
  • 注册时间: 2013-05-02 16:15
文章分类

全部博文(103)

文章存档

2014年(8)

2013年(95)

我的朋友

分类: Python/Ruby

2013-12-19 21:30:27

import wx
import sys
class Frame(wx.Frame):
    """Frame class that displays an image"""
    def __init__(self,parent,id,title):
        print "Frame __init__"
        wx.Frame.__init__(self,parent,id,title)
class App(wx.App):
    def __init__(self,redirect=True,filename=None):
        print "App __init__"
        wx.App.__init__(self,redirect,filename)
    def OnInit(self):
        print "OnInit"
        self.frame = Frame(parent=None,id=1,title="startup")

        self.frame.Show()
        print sys.stderr,"A pretend error message"
        return True
    def OnExit(self):
        print "OnExit"
def main():
    app = App(redirect=False)#1
    print "before MailLoop"
    app.MainLoop()#2
    print "after MainLoop"

if __name__=="__main__":
    main()


App __init__
OnInit
Frame __init__
', mode 'w' at 0x0000000001D16150> A pretend error message
before MailLoop
OnExit
after MainLoop

阅读(1288) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~