Reputation: 3
So, I have been trying to learn wxpython using the videos on thenewboston.com, but when I run this code all I get is a blank grey window. The size of the window doesn't even change when I change the size in the code! Also the window title, buttons,and panels don't appear its just blank. Im using Linux Mint so I think this may be the cause. Please help me fix this!
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()
Thanks in advance :)
Upvotes: 0
Views: 588