[問題] wxPython與pyGame整合

看板Python作者 (Yo)時間13年前 (2012/06/05 14:26), 編輯推噓0(003)
留言3則, 2人參與, 最新討論串1/1
各位Python高手大家好,最近我在撰寫個程式,要讓wxPython的介面上, 整合一個PyGame的介面來播放影片,所以我找到這個網址有範例檔案: http://wiki.wxpython.org/IntegratingPyGame 但在第7行的 self.hwnd = self.GetChildren()[0].GetHandle() 我遇到了錯誤,爬文了很久找不到如何解決。 File "F:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 10266, in GetHandle return _core_.Window_GetHandle(*args, **kwargs) TypeError: in method 'Window_GetHandle', expected argument 1 of type 'wxWindow *' 請問是否大家有沒有甚麼建議或解決方法呢? 謝謝!! 作業系統: WIN 7 Python版本: 2.7 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.120.54.165

06/05 18:28, , 1F
建議你把 wx 和 pygame 的視窗分成兩個。兩者之間只
06/05 18:28, 1F

06/05 18:29, , 2F
傳參數,而不要傳事件 (event) ,以後維護時會輕鬆些
06/05 18:29, 2F

06/05 23:11, , 3F
好,謝謝你的建議! :)
06/05 23:11, 3F
文章代碼(AID): #1FpQQ5fs (Python)
文章代碼(AID): #1FpQQ5fs (Python)