【发布时间】:2013-03-17 11:38:13
【问题描述】:
通过导入wx.stc 在 wxpython 中使用 StyledTextControl,我如何将 Enter 键捕获为事件?我尝试了几种方法,但似乎都说错误或根本不起作用。
我太公平了:
self.text.Bind(wx.stc.STC_KEY_DOWN, self.hw)
def hw(self, event):
if event.GetKeyCode == wx.stc.STC_KEY_RETURN:
self.text.AddText('Hello World')
event.Skip()
self.text 是我的stc。
只是似乎不适合我。我是使用 wx 函数还是 stc 函数来捕获事件?
【问题讨论】: