当前位置:Linux教程 - Linux资讯 - Python的wxPython示例代码分析----ShapeWidnow

Python的wxPython示例代码分析----ShapeWidnow

  [myPHP] #!/usr/bin/env python # -*- coding:gb2312 -*- #导入wXPython基础模块 from wxPython.wx import * #定义一个新的frame类 class TestFrame(wxFrame): def __init__(self): #调用父类的构造函数,并仔细看其窗口类型的设定 #关键的问题就是窗口的边框类型的设定 wxFrame.__init__(self, None, -1, u"无边框窗口", \ style = \ wxFRAME_SHAPED\ wxSIMPLE_BORDER\ wxFRAME_NO_TASKBAR\ wxSTAY_ON_TOP ) label1 = wxStaticText(self, -1, u"看到了吗?", size=(300,200)) self.hasShape = False self.delta = wxPoint(0, 0) class MyApp(wxApp): def OnInit(self): f = TestFrame() f.Show(true) self.SetTopWindow(f) return true if ( __name__ == "__main__" ): a = MyApp(0) a.MainLoop() [/myphp]

(出处:http://www.sheup.com)