[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]