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

Method set_samples

Lib/idlelib/configdialog.py:437–448  ·  view source on GitHub ↗

Update both screen samples with the font settings. Called on font initialization and change events. Accesses font_name, font_size, and font_bold Variables. Updates font_sample and highlight page highlight_sample.

(self, event=None)

Source from the content-addressed store, hash-verified

435 self.font_name.set(font.lower())
436
437 def set_samples(self, event=None):
438 """Update both screen samples with the font settings.
439
440 Called on font initialization and change events.
441 Accesses font_name, font_size, and font_bold Variables.
442 Updates font_sample and highlight page highlight_sample.
443 """
444 font_name = self.font_name.get()
445 font_weight = tkfont.BOLD if self.font_bold.get() else tkfont.NORMAL
446 new_font = (font_name, self.font_size.get(), font_weight)
447 self.font_sample['font'] = new_font
448 self.highlight_sample['font'] = new_font
449
450
451class HighPage(Frame):

Callers 3

load_font_cfgMethod · 0.95
var_changed_fontMethod · 0.95
test_set_samplesMethod · 0.80

Calls 1

getMethod · 0.45

Tested by 1

test_set_samplesMethod · 0.64