python - WxPython windows does not popup -
i've written following snippet display simple window.
it neither show window nor reports error:
import wx class myframe (wx.app) : def __init__(self): x = wx.frame.__init__(self, "", size=(200,200), title="thanks", style= wx.system_menu | wx.close_box | wx.close) x.show(true) frm = wx.app(false) things = myframe frm.mainloop()
you have few problems in code.
may want start following code:
import wx class myframe (wx.frame): #inherits frame not application def __init__(self, parent): wx.frame.__init__(self, parent, -1, size=(200,200), title="thanks") # note order of 3 positional arguments above # second 1 parent frame (none here) , third window id frm = wx.app(false) things = myframe(none) # must call class create instance things.show() # correct position show frm.mainloop() if run code empty frame. here can try different styles if want.
Comments
Post a Comment