ここに私のコードがあります
python 2.7 & wxpython 2.8
これら 3 つの textctrl、chat_c(textctrl) で
chat_c と text_c をチャットルームのようにしたい
入力はchat_c 出力はtext_c
それが私が使う理由です
def OnReturnDown(self,e):
key = e.GetKeyCode()
self.text_c.SetValue(key) #for check out but doesn't work
if key == wx.WXK_RETURN:
self.text_c.SetValue(self.chat_c.GetValue())
#key bind
self.chat_c.Bind(wx.EVT_KEY_DOWN, self.OnReturnDown)
これはエラーメッセージです
Traceback (most recent call last):
File "C:\workspace\wx_python_test\main_chat_client.py", line 239, in OnReturnDown
self.text_c.SetValue(key) #for check out but doesn't work
File "C:\Python27\Lib\site-packages\wx-2.8-msw-unicode\wx\_controls.py", line 1754, in SetValue
return _controls_.TextCtrl_SetValue(*args, **kwargs)
TypeError: String or Unicode type required
それは何ですか?Unicode タイプが必要ですか???
おそらくtextctrlのスタイルを変更しますか?
どうすればこれを修正できますか?