【问题标题】:wxpython not working properly on Linux Mintwxpython 在 Linux Mint 上无法正常工作
【发布时间】:2012-06-01 08:01:30
【问题描述】:

所以,我一直在尝试使用 thenewboston.com 上的视频来学习 wxpython,但是当我运行这段代码时,我得到的只是一个空白的灰色窗口。当我在代码中更改大小时,窗口的大小甚至都不会改变!窗口标题、按钮和面板也不会显示为空白。我正在使用 Linux Mint,所以我认为这可能是原因。请帮我解决这个问题!

import wx

class mainApp(wx.Frame):

    def __init_(self,parent,id):
        wx.Frame.__init__(self,parent,id,title = 'Frame aka Window',size=(800,900))
        panel=wx.Panel(self)
        buttonExit=wx.Button(panel,label="Quit", pos=(50,50),size=(60,60))
        self.Bind(wx.EVT_BUTTON,self.closebutton,buttonExit)
        self.Bind(wx.EVT_CLOSE,self.closewindow)

    def closebutton(self,event):
        self.Close(True)

    def closewindow(self,event):
        self.Destroy()



if __name__ == '__main__':
    app = wx.PySimpleApp()
    frame=mainApp(parent=None,id=-1)
    frame.Show()
    app.MainLoop()

提前致谢:)

【问题讨论】:

    标签: python wxpython


    【解决方案1】:

    你拼错了__init____init_:)

    【讨论】:

    • 哦!我觉得好蠢! xD 谢谢!哈哈
    猜你喜欢
    • 2020-06-26
    • 2020-01-08
    • 2019-02-26
    • 1970-01-01
    • 1970-01-01
    • 2019-12-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多