Text组件新增内容时,可以通过tag_config给特定的字符串设定前景色、背景色等属性。
self.text1.tag_config('red',foreground = 'red',background = 'yellow') #消息列表分区中创建标签,ys2样式2的前景色为red
self.text1.insert(END,str(msg) + '\n','red')
Text组件新增内容时,可以通过tag_config给特定的字符串设定前景色、背景色等属性。
self.text1.tag_config('red',foreground = 'red',background = 'yellow') #消息列表分区中创建标签,ys2样式2的前景色为red
self.text1.insert(END,str(msg) + '\n','red')