我已經爲測試筆記本方法做了這個簡單的代碼,我發現了一些非常奇怪的東西,但我不是一個Python/wxpython專家,我決定問你我是否犯了錯誤,或者如果這是一個錯誤。 的代碼是:wxPython可能筆記本GetPage缺陷
import wx
class Note(wx.Notebook):
def __init__(self, parent):
wx.Notebook.__init__(self, parent)
self.dummy = 0#or self.panel = wx.Panel(self) or evry other thing with the self.
wx.Notebook.AddPage(self, wx.Panel(self), 'page')
app = wx.App()
f = wx.Frame(None)
n = Note(f)
#the code works up to here
n.GetPage(0)#with this line the progra crash
當我在注類對象變量放置時,我調用GETPAGE方法程序崩潰(如自)。這是做這件事的筆記本唯一的方法,我真的不知道爲什麼。 我的Python版本是3.4.3,而wxPython Phoenix版本是3.0.3。
這在wxPython經典3.0.2和2.8的工程,所以它可能是一個錯誤在鳳凰或一些不應該工作直到「MainLoop」被調用。 –