wxpython deconstruct
来源:互联网 发布:linux scan 编辑:程序博客网 时间:2024/06/03 17:06
Thanks for the suggestion - I did that and indeed FooButton is not seen
at all as a child of Panel.
So perhaps something was wrong in the way I wrote the swig interface file?
Ok, I really should have seen this earlier, it's been a while since I spent a lot of time on Classic though. The issue is that by default instances of classes that have a destructor will be destroyed when the Python proxy object's ref count drops to zero. Since widget objects are owned by their parent window then we don't want that to happen, their destructions should instead be controlled by their parent. Since there wasn't a good way to do that in SWIG when wxPython was starting out I instead chose to just not let it see that there is a destructor in those classes.
So to fix your problem just comment out the ~FooButton line in your .i file.
at all as a child of Panel.
So perhaps something was wrong in the way I wrote the swig interface file?
Ok, I really should have seen this earlier, it's been a while since I spent a lot of time on Classic though. The issue is that by default instances of classes that have a destructor will be destroyed when the Python proxy object's ref count drops to zero. Since widget objects are owned by their parent window then we don't want that to happen, their destructions should instead be controlled by their parent. Since there wasn't a good way to do that in SWIG when wxPython was starting out I instead chose to just not let it see that there is a destructor in those classes.
So to fix your problem just comment out the ~FooButton line in your .i file.
0 0
- wxpython deconstruct
- wxPython
- wxPython
- wxPython
- wxpython
- wxPython
- wxpython
- wxPython之hello wxPython
- wxPython:关闭wxPython程序
- 【wxPython】wxPython简介
- wxPython.wx
- wxPython menu
- wxpython trick
- wxPython简介
- wxPython 入门
- Hello,wxPython
- 学习wxpython
- wxPython 入门
- 第二次作业
- 计算机网络实验--(socket的简单练习)
- IDE、SATA、SCSI、FC、SAS简介与区别
- SATA、SCSI、SAS区别与特点
- Android实现的ListView-ListViewAdapter(新闻列表事例)
- wxpython deconstruct
- 如何理解LPCTSTR
- 一名无助的留学生
- JNI使用:步步解析
- c语言期末编程
- 学习-Handler的使用方法
- Linux基础学习
- js实现瀑布流
- Struts2的工作原理