Set color options of Text widget. If ColorDelegator is used, this should be called first.
(text)
| 85 | |
| 86 | |
| 87 | def color_config(text): |
| 88 | """Set color options of Text widget. |
| 89 | |
| 90 | If ColorDelegator is used, this should be called first. |
| 91 | """ |
| 92 | # Called from htest, TextFrame, Editor, and Turtledemo. |
| 93 | # Not automatic because ColorDelegator does not know 'text'. |
| 94 | theme = idleConf.CurrentTheme() |
| 95 | normal_colors = idleConf.GetHighlight(theme, 'normal') |
| 96 | cursor_color = idleConf.GetHighlight(theme, 'cursor')['foreground'] |
| 97 | select_colors = idleConf.GetHighlight(theme, 'hilite') |
| 98 | text.config( |
| 99 | foreground=normal_colors['foreground'], |
| 100 | background=normal_colors['background'], |
| 101 | insertbackground=cursor_color, |
| 102 | selectforeground=select_colors['foreground'], |
| 103 | selectbackground=select_colors['background'], |
| 104 | inactiveselectbackground=select_colors['background'], # new in 8.5 |
| 105 | ) |
| 106 | |
| 107 | |
| 108 | class ColorDelegator(Delegator): |
no test coverage detected
searching dependent graphs…