当前位置:网站首页>The new content of the text component can be added through the tag_ Config set foreground and background colors

The new content of the text component can be added through the tag_ Config set foreground and background colors

2022-07-05 22:08:00 Moxianzhe

Text When adding content to a component , Can pass tag_config Set the foreground color for a specific string 、 Background color and other properties .

        self.text1.tag_config('red',foreground = 'red',background = 'yellow') # Create tags in the message list partition ,ys2 style 2 The foreground color of the picture is red
        self.text1.insert(END,str(msg) + '\n','red')

原网站

版权声明
本文为[Moxianzhe]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/186/202207052204063430.html