Added first experiment on focus mode for chat history

This commit is contained in:
2018-12-04 17:53:10 -06:00
parent 331636b9f4
commit 04102677f2
2 changed files with 44 additions and 17 deletions

View File

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