求问:mypython的小例子AttributeError: 'SimpleEditor' object has no attribute 'OnMouseDown'
来源:互联网 发布:树熊网络大庆 编辑:程序博客网 时间:2024/05/17 00:17
我想点击一个按钮触发事件,但是总是抱错,菜鸟新手求教(红色部分出错)
import wx
class SimpleEditor(wx.Frame):
def __init__(self, parent, id, title):
wx.Frame.__init__(self, parent, id, title, wx.DefaultPosition, wx.Size(250,300))
panel=wx.Panel(self,-1)
box=wx.BoxSizer(wx.HORIZONTAL)
self.button = wx.Button(panel, -1, "Enter Question", pos=(50, 200))
#self.Bind(wx.EVT_BUTTON, self.OnMouseDown, self.button)
self.button.SetDefault()
multiText=wx.TextCtrl(panel,-1,
size=(240,180),
style=wx.TE_MULTILINE)
def OnMouseDown(self, event):
frame1 = SimpleEditor2(None, wx.ID_ANY, 'a')
frame1.Show()
class SimpleEditor2(wx.Frame):
def __init__(self, parent, id, title):
wx.Frame.__init__(self, parent, id, title, wx.DefaultPosition, wx.Size(250,300))
self.button = wx.Button(panel, -1, "Return", pos=(50, 200))
self.button.SetDefault()
if __name__=='__main__':
app = wx.PySimpleApp()
frame = SimpleEditor(None, wx.ID_ANY, 'Enter Question')
frame.Show()
app.MainLoop()
Traceback (most recent call last):
File "D:\python\py exp\test", line 30, in <module>
frame = SimpleEditor(None, wx.ID_ANY, 'Enter Question')
File "D:\python\py exp\test", line 9, in __init__
self.button.Bind(wx.EVT_BUTTON, self.OnMouseDown, self.button)
AttributeError: 'SimpleEditor' object has no attribute 'OnMouseDown'
- 求问:mypython的小例子AttributeError: 'SimpleEditor' object has no attribute 'OnMouseDown'
- AttributeError: '_Screen' object has no attribute 'onkeypress' python 的例子
- AttributeError: 'module' object has no attribute 的解决方法
- AttributeError: 'module' object has no attribute 的解决方法
- AttributeError: 'module' object has no attribute 的解决方法
- AttributeError: 'module' object has no attribute 的解决方法
- 对于AttributeError: 'Flask' object has no attribute 'cli'的解决办法
- AttributeError: 'NoneType' object has no attribute 'execute' 错误的解决
- AttributeError: 'classmethod' object has no attribute '__module__'
- AttributeError: 'module' object has no attribute 'getpass'
- AttributeError: ‘NoneType’ object has no attribute ‘clone’
- AttributeError: 'module' object has no attribute 'Serial'
- AttributeError: 'NoneType' object has no attribute 'clone'
- AttributeError: 'tuple' object has no attribute 'Multi'
- AttributeError: 'Response' object has no attribute 'json'
- AttributeError: 'module' object has no attribute(转)
- AttributeError: 'Connection' object has no attribute 'connection_errors'
- AttributeError: 'module' object has no attribute 'randint'
- ibatis pojo xml配置
- 关于判断Socket断开的问题
- Effective C++
- iOS学习笔记——表视图二(编辑)
- 如何使用strace+pstack利器分析程序性能
- 求问:mypython的小例子AttributeError: 'SimpleEditor' object has no attribute 'OnMouseDown'
- 检测清扫
- CSS居中经验谈-用法实例详解
- C++ const引用详解
- 指定日期往后加一月
- 第二天
- ccpNormalize分析
- Android 文件下载大小和网络不一致(偏大)
- 极速理解设计模式系列:5.单例模式(Singleton Pattern)