Created
December 14, 2014 14:27
-
-
Save tai-sho/75819d51510f8701fbb2 to your computer and use it in GitHub Desktop.
wxPythonでGUIアプリケーションを作成するサンプル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: cp932 -*- | |
import wx | |
class MyFrame(wx.Frame): | |
def __init__(self, parent, title): | |
wx.Frame.__init__(self, parent, title=title, size=(500,500),pos=(10,10)) | |
#ステータスバー | |
self.CreateStatusBar() | |
#ファイルメニュー | |
filemenu = wx.Menu() | |
filemenu.Append(wx.ID_NEW, '&New', 'create new project') | |
filemenu.Append(wx.ID_OPEN, '&Open', 'open project') | |
filemenu.AppendSeparator() | |
#編集メニュー | |
editmenu = wx.Menu() | |
editmenu.Append(wx.ID_CUT, '&Cut', 'cut strings') | |
editmenu.Append(wx.ID_COPY, '&Copy', 'copy strings') | |
#メニュ-バーの作成 | |
menuBar = wx.MenuBar() | |
#ファイルメニューを登録 | |
menuBar.Append(filemenu, '&File') | |
#編集メニューを登録 | |
menuBar.Append(editmenu, '&Edit') | |
self.SetMenuBar(menuBar) | |
self.Show(True) | |
application = wx.App(False) | |
frame = MyFrame(None, 'TestApplication') | |
application.MainLoop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment