国产99久久精品_欧美日本韩国一区二区_激情小说综合网_欧美一级二级视频_午夜av电影_日本久久精品视频

最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關鍵字專題關鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
當前位置: 首頁 - 科技 - 知識百科 - 正文

基于wxpython實現的windowsGUI程序實例

來源:懂視網 責編:小采 時間:2020-11-27 14:41:20
文檔

基于wxpython實現的windowsGUI程序實例

基于wxpython實現的windowsGUI程序實例:本文實例講述了基于wxpython實現的windows GUI程序。分享給大家供大家參考。具體如下: # using a wx.Frame, wx.MenuBar, wx.Menu, wx.Panel, wx.StaticText, wx.Button, # and a wx.BoxSizer to show a rudi
推薦度:
導讀基于wxpython實現的windowsGUI程序實例:本文實例講述了基于wxpython實現的windows GUI程序。分享給大家供大家參考。具體如下: # using a wx.Frame, wx.MenuBar, wx.Menu, wx.Panel, wx.StaticText, wx.Button, # and a wx.BoxSizer to show a rudi

本文實例講述了基于wxpython實現的windows GUI程序。分享給大家供大家參考。具體如下:

# using a wx.Frame, wx.MenuBar, wx.Menu, wx.Panel, wx.StaticText, wx.Button, 
# and a wx.BoxSizer to show a rudimentary wxPython Windows GUI application
# wxPython package from: http://prdownloads.sourceforge.net/wxpython/
# I downloaded: wxPython2.5-win32-ansi-2.5.3.1-py23.exe
# if you have not already done so install the Python compiler first
# I used Python-2.3.4.exe (the Windows installer package for Python23) 
# from http://www.python.org/2.3.4/
# tested with Python23 vegaseat 24jan2005
import wx
class Frame1(wx.Frame):
 # create a simple windows frame (sometimes called form)
 # pos=(ulcX,ulcY) size=(width,height) in pixels
 def __init__(self, parent, title):
 wx.Frame.__init__(self, parent, -1, title, pos=(150, 150), size=(350, 250))
 # create a menubar at the top of the user frame
 menuBar = wx.MenuBar()
 # create a menu ... 
 menu = wx.Menu()
 # ... add an item to the menu
 # 	Alt-X creates an accelerator for Exit (Alt + x keys)
 # the third parameter is an optional hint that shows up in 
 # the statusbar when the cursor moves across this menu item
 menu.Append(wx.ID_EXIT, "E&xit	Alt-X", "Exit the program")
 # bind the menu event to an event handler, share QuitBtn event
 self.Bind(wx.EVT_MENU, self.OnQuitButton, id=wx.ID_EXIT)
 # put the menu on the menubar
 menuBar.Append(menu, "&File")
 self.SetMenuBar(menuBar)
 # create a status bar at the bottom of the frame
 self.CreateStatusBar()
 # now create a panel (between menubar and statusbar) ...
 panel = wx.Panel(self)
 # ... put some controls on the panel
 text = wx.StaticText(panel, -1, "Hello World!")
 text.SetFont(wx.Font(24, wx.SCRIPT, wx.NORMAL, wx.BOLD))
 text.SetSize(text.GetBestSize())
 quitBtn = wx.Button(panel, -1, "Quit")
 messBtn = wx.Button(panel, -1, "Message")
 # bind the button events to event handlers
 self.Bind(wx.EVT_BUTTON, self.OnQuitButton, quitBtn)
 self.Bind(wx.EVT_BUTTON, self.OnMessButton, messBtn)
 # use a sizer to layout the controls, stacked vertically
 # with a 10 pixel border around each
 sizer = wx.BoxSizer(wx.VERTICAL)
 sizer.Add(text, 0, wx.ALL, 10)
 sizer.Add(quitBtn, 0, wx.ALL, 10)
 sizer.Add(messBtn, 0, wx.ALL, 10)
 panel.SetSizer(sizer)
 panel.Layout()
 def OnQuitButton(self, evt):
 # event handler for the Quit button click or Exit menu item
 print "See you later alligator! (goes to stdout window)"
 wx.Sleep(1) # 1 second to look at message
 self.Close()
 def OnMessButton(self, evt):
 # event handler for the Message button click
 self.SetStatusText('101 Different Ways to Spell "Spam"')
class wxPyApp(wx.App):
 def OnInit(self):
 # set the title too
 frame = Frame1(None, "wxPython GUI 2")
 self.SetTopWindow(frame)
 frame.Show(True)
 return True
# get it going ...
app = wxPyApp(redirect=True)
app.MainLoop()

希望本文所述對大家的Python程序設計有所幫助。

聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

文檔

基于wxpython實現的windowsGUI程序實例

基于wxpython實現的windowsGUI程序實例:本文實例講述了基于wxpython實現的windows GUI程序。分享給大家供大家參考。具體如下: # using a wx.Frame, wx.MenuBar, wx.Menu, wx.Panel, wx.StaticText, wx.Button, # and a wx.BoxSizer to show a rudi
推薦度:
標簽: Windows 實例 gui
  • 熱門焦點

最新推薦

猜你喜歡

熱門推薦

專題
Top
主站蜘蛛池模板: 久国产精品视频 | 亚洲欧美日本在线 | 91日韩欧美 | 欧美日韩高清 | 国产日韩欧美高清 | 欧美中文一区 | 91一区二区在线观看精品 | 成人精品一区二区三区 | a欧美| 久久久久亚洲精品美女 | 欧美成人精品高清在线播放 | 国产成人精品一区 | 精品日韩一区二区 | 午夜不卡视频 | 欧美 日韩 中文 | 亚洲码欧美码一区二区三区 | 亚洲综合日韩 | 亚洲欧洲高清 | 欧美激情亚洲一区中文字幕 | 国产精品毛片久久久久久久 | 国产小视频在线免费观看 | 国产精品免费网站 | 亚洲午夜精品 | 欧美成人禁片在线观看网址 | 一区二区在线观看视频 | 欧美亚洲综合一区 | 亚洲自拍另类 | 另类国产精品一区二区 | 欧美色图在线观看 | 国产精品综合色区在线观看 | 香蕉91 | 欧美日韩三级在线 | 美女视频黄a视频免费全过程在线 | 国产日韩精品欧美一区视频 | 91精品一区二区三区在线观看 | 欧美日韩操 | 黑人群性xxx| 韩国理论三级在线观看视频 | 精品久久久久久久中文字幕 | 欧美人善交| 亚洲香蕉久久综合网 |