国产片侵犯亲女视频播放_亚洲精品二区_在线免费国产视频_欧美精品一区二区三区在线_少妇久久久_在线观看av不卡

腳本之家,腳本語言編程技術及教程分享平臺!
分類導航

Python|VBS|Ruby|Lua|perl|VBA|Golang|PowerShell|Erlang|autoit|Dos|bat|

服務器之家 - 腳本之家 - Python - 基于wxpython實現的windows GUI程序實例

基于wxpython實現的windows GUI程序實例

2020-07-09 08:52皮蛋 Python

這篇文章主要介紹了基于wxpython實現的windows GUI程序,實例分析了windows GUI程序的相關實現技巧,需要的朋友可以參考下

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

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# 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
    # \tAlt-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\tAlt-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程序設計有所幫助。

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 国产精品视频播放 | 国产精品久久久久久久久免费桃花 | 日日操天天爽 | 黑人草逼视频 | 国产一级二级毛片 | 国产中文久久 | 亚洲欧美在线视频 | 成人精品久久 | 亚洲午夜免费视频 | 欧美 日韩 综合 | 国产精品1区 | 亚洲美女久久 | 午夜精品一区二区三区在线观看 | 在线观看的av | 在线a视频 | 欧美日韩国产精品 | 欧美日韩国产一区二区三区 | 中文字幕免费中文 | 国产精品美女久久久久久久网站 | 中文在线一区二区三区 | 欧美日韩国产一区 | 人人做人人澡人人爽欧美 | 国产精品久久九九 | 91精品一区二区三区久久久久久 | 成人不卡视频 | www.you日本 | 日日夜夜一区二区 | 欧美日韩在线一区 | 亚洲视频 中文字幕 | 久久久久久久久99精品 | 久久精品中文字幕 | 特一级毛片 | 亚洲欧美视频在线 | 国产精品免费久久久久久久久久中文 | 欧美日韩在线综合 | 久久久久久免费精品 | 亚洲精品久久久久久国产精华液 | 成人精品动漫一区二区三区 | 免费一级黄色录像 | 毛片一级在线 | 一区二区三区亚洲 |