vendredi 29 mai 2015

TypeError: in method 'new_Frame', expected argument 2 of type 'int'

import wx
class MainWindow(wx.Frame):
    def _init_ (self, parent, title):
        wx.Frame. __init__(self, parent, title=title, size=(200, 100))
        self.control = wx.TextCtrl(self, style=wx.TE_MULTILINE)
        self.CreateStatusBar()

        #setting up the menu

        filemenu = wx.Menu()

        menuAbout = filemenu.Append(wx.ID_ABOUT, "About", "information about the use of this program")
        menuExit = filemenu.Append(wx.ID_EXIT, "Exit", "Exit this program")

        menuBar = wx.MenuBar()

        menuBar.Append(filemenu,"File")
        self.SetMenuBar(menuBar)
        self.Bind(wx.EVT_MENU, self.OnAbout, menuAbout)
        self.Bind(wx.EVT_MENU, self.OnExit, menuExit)

        self.Show(True)

    def OnAbout(self,e):
        dlg = wx.MessageDialog(self, "A small text editor", "About sample     editor", wx.OK)
        dlg.ShowModal()
        dlg.Destroy()

    def OnExit(self,e):
        self.Close(True)
    app = wx.App(False)
    frame = MainWindow(None, "sample editor")
    app.MainLoop()

Aucun commentaire:

Enregistrer un commentaire