MCPcopy Index your code
hub / github.com/python/cpython / color_config

Function color_config

Lib/idlelib/colorizer.py:87–105  ·  view source on GitHub ↗

Set color options of Text widget. If ColorDelegator is used, this should be called first.

(text)

Source from the content-addressed store, hash-verified

85
86
87def 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
108class ColorDelegator(Delegator):

Callers 4

__init__Method · 0.90
__init__Method · 0.90
makeTextFrameMethod · 0.90
_color_delegatorFunction · 0.85

Calls 3

CurrentThemeMethod · 0.80
GetHighlightMethod · 0.80
configMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…