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

Method create_page_font

Lib/idlelib/configdialog.py:289–376  ·  view source on GitHub ↗

Return frame of widgets for Font tab. Fonts: Enable users to provisionally change font face, size, or boldness and to see the consequence of proposed choices. Each action set 3 options in changes structuree and changes the corresponding aspect of the font sample on

(self)

Source from the content-addressed store, hash-verified

287 self.load_font_cfg()
288
289 def create_page_font(self):
290 """Return frame of widgets for Font tab.
291
292 Fonts: Enable users to provisionally change font face, size, or
293 boldness and to see the consequence of proposed choices. Each
294 action set 3 options in changes structuree and changes the
295 corresponding aspect of the font sample on this page and
296 highlight sample on highlight page.
297
298 Function load_font_cfg initializes font vars and widgets from
299 idleConf entries and tk.
300
301 Fontlist: mouse button 1 click or up or down key invoke
302 on_fontlist_select(), which sets var font_name.
303
304 Sizelist: clicking the menubutton opens the dropdown menu. A
305 mouse button 1 click or return key sets var font_size.
306
307 Bold_toggle: clicking the box toggles var font_bold.
308
309 Changing any of the font vars invokes var_changed_font, which
310 adds all 3 font options to changes and calls set_samples.
311 Set_samples applies a new font constructed from the font vars to
312 font_sample and to highlight_sample on the highlight page.
313
314 Widgets for FontPage(Frame): (*) widgets bound to self
315 frame_font: LabelFrame
316 frame_font_name: Frame
317 font_name_title: Label
318 (*)fontlist: ListBox - font_name
319 scroll_font: Scrollbar
320 frame_font_param: Frame
321 font_size_title: Label
322 (*)sizelist: DynOptionMenu - font_size
323 (*)bold_toggle: Checkbutton - font_bold
324 frame_sample: LabelFrame
325 (*)font_sample: Label
326 """
327 self.font_name = tracers.add(StringVar(self), self.var_changed_font)
328 self.font_size = tracers.add(StringVar(self), self.var_changed_font)
329 self.font_bold = tracers.add(BooleanVar(self), self.var_changed_font)
330
331 # Define frames and widgets.
332 frame_font = LabelFrame(self, borderwidth=2, relief=GROOVE,
333 text=' Shell/Editor Font ')
334 frame_sample = LabelFrame(self, borderwidth=2, relief=GROOVE,
335 text=' Font Sample (Editable) ')
336 # frame_font.
337 frame_font_name = Frame(frame_font)
338 frame_font_param = Frame(frame_font)
339 font_name_title = Label(
340 frame_font_name, justify=LEFT, text='Font Face :')
341 self.fontlist = Listbox(frame_font_name, height=15,
342 takefocus=True, exportselection=FALSE)
343 self.fontlist.bind('<ButtonRelease-1>', self.on_fontlist_select)
344 self.fontlist.bind('<KeyRelease-Up>', self.on_fontlist_select)
345 self.fontlist.bind('<KeyRelease-Down>', self.on_fontlist_select)
346 scroll_font = Scrollbar(frame_font_name)

Callers 1

__init__Method · 0.95

Calls 15

StringVarClass · 0.90
BooleanVarClass · 0.90
FrameClass · 0.90
LabelClass · 0.90
ListboxClass · 0.90
ScrollbarClass · 0.90
DynOptionMenuClass · 0.90
CheckbuttonClass · 0.90
ScrollableTextFrameClass · 0.90
LabelFrameClass · 0.85
addMethod · 0.45
bindMethod · 0.45

Tested by

no test coverage detected