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

Method set_highlight_target

Lib/idlelib/configdialog.py:954–980  ·  view source on GitHub ↗

Set fg/bg toggle and color based on highlight tag target. Instance variables accessed: highlight_target Attributes updated: fg_on bg_on fg_bg_toggle Methods: set_color_sample Called from: var_

(self)

Source from the content-addressed store, hash-verified

952 self.set_theme_type()
953
954 def set_highlight_target(self):
955 """Set fg/bg toggle and color based on highlight tag target.
956
957 Instance variables accessed:
958 highlight_target
959
960 Attributes updated:
961 fg_on
962 bg_on
963 fg_bg_toggle
964
965 Methods:
966 set_color_sample
967
968 Called from:
969 var_changed_highlight_target
970 load_theme_cfg
971 """
972 if self.highlight_target.get() == 'Cursor': # bg not possible
973 self.fg_on.state(('disabled',))
974 self.bg_on.state(('disabled',))
975 self.fg_bg_toggle.set(1)
976 else: # Both fg and bg can be set.
977 self.fg_on.state(('!disabled',))
978 self.bg_on.state(('!disabled',))
979 self.fg_bg_toggle.set(1)
980 self.set_color_sample()
981
982 def set_color_sample_binding(self, *args):
983 """Change color sample based on foreground/background toggle.

Callers 2

load_theme_cfgMethod · 0.95

Calls 4

set_color_sampleMethod · 0.95
getMethod · 0.45
stateMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected