Improved chats focusing. Now they should work properly

This commit is contained in:
2018-12-05 12:43:33 -06:00
parent 04102677f2
commit 73fa9532b5
2 changed files with 21 additions and 13 deletions

View File

@@ -176,12 +176,12 @@ class chatTab(wx.Panel):
return box
def set_focus_function(self, focus_function):
self.history.Bind(wx.EVT_CHAR_HOOK, focus_function)
self.history.Bind(wx.EVT_KEY_UP , focus_function)
def add_message(self, message, reverse=False):
old_line = self.history.GetNumberOfLines()#.count("\n")
point = self.history.GetInsertionPoint()
if reversed:
if reverse:
self.history.SetValue(message+"\n"+self.history.GetValue())
else:
self.history.AppendText(message+"\n")